Victor Mlotshwa, 27, told the court how he was forced into a coffin, allegedly by farmers Theo Martins Jackson and Willem Oosthuizen.
The pair deny several charges including kidnapping, attempted murder and possession of an illegal firearm.
The case has caused outrage in South Africa and highlighted racial tensions in the town's farming communities.
A video of the incident was shown in court, in which Mr Mlotshwa was heard crying and pleading.
He told the Middleburg High Court that his mother had sent him to Middleburg, a small farming town, to buy stock for her shop, when he came across one of the suspects while using a foot path as a short-cut through the farm.
Mr Mlotshwa only reported the matter after footage of the alleged assault in August 2016 emerged on YouTube months later.
"I thought these men were going to kill me. They were kicking me with their boots and pressing me down," he told a packed courtroom.
Local papers report that gasps could be heard in the courtroom when a two-minute video of the assault was played, while some people walked out.
Mr Mlotshwa was heard pleading for his life, explaining that he had not stolen and copper cables as they accused him of doing.
He gave a detailed account of how the men bound him with cable ties, beat him and threatened to shoot him if he did not get into the wooden coffin as he was told.
In a court affidavit, the pair, who are out on bail, said they didn't mean to harm him but merely wanted to "teach him a lesson".
The trial continues on Friday.
The victim in South Africa's coffin assault case has broken down during the trial of his alleged attackers.