Two Adelaide prisoners accused of restraining and raping an inmate in a shared cell have gone on trial in the District Court.

Matthew James Stone, 30, and Corey Daniel Jeffrey, 26, pleaded not guilty to supplying a prescription drug and four counts of rape.

It was alleged that while in a three-man cell at Yatala Labour Prison in November 2014, the two inmates threatened to bash a younger cell mate and forced him to smoke a drug before taking it in turns to rape him.

Prosecutor Chris Edge told the jury the alleged victim, who was 20 years old at the time, was frightened and was locked in the cell with the two other men.

"On that Wednesday evening during lockdown when the three men were alone in the cell, it's alleged the two accused forcibly restrained and repeatedly raped [the complainant]," Mr Edge told the jury.

"The two accused were both older and quite a bit bigger than him, [the complainant] is a small fairly juvenile looking young man."

The court heard the prescription drug the men allegedly forced on the complainant caused him to become dizzy and light-headed.

Mr Edge said the man was allegedly threatened and told not to tell anyone, but later told a cellmate when he was moved to a different division.

The trial continues.