Khader Saleh, 25, was attacked by fellow inmate Kalifa Dibbassey, 21, after visiting his cell to try to resolve a dispute, jurors were told.
Dibbassey is on trial at the Old Bailey accused of murder alongside Ahmed Khayre, 22, and Enton Marku, 20, who were allegedly recruited to help on January 31.
opening the trial, Oliver Glasgow QC said: “It appears that Khader Saleh had gone to this cell in the hope of trying to resolve a conflict that he had with Kalifa Dibbassey.
“However, he could have had no idea what lay in wait for him.
“Kalifa Dibbassey had armed himself with a makeshift knife for the purpose of attacking Khader Saleh and had gone to the trouble of recruiting help in order that he could carry out his plan.”
Marku was waiting outside the cell and Khayre escorted the victim inside, it is claimed.
Mr Glasgow told jurors: “Once the cell door was shut, Khader Saleh was attacked and stabbed twice.
“He had no chance to defend himself or to strike out at his attackers, which is why the only person to sustain any injury in that cell was Khader Saleh.”
Afterwards, the defendants allegedly set off an alarm before climbing into a neighbouring cell and setting off an alarm there too.
They got away when a prison guard unlocked the cell door moments later, the Old Bailey was told.
Mr Glasgow said the attack appeared to have been sparked by a “minor altercation” in the segregation unit the day before.
He said: “No-one saw what happened but Khader Saleh had sustained an injury to his face and it was evident that a fight had broken out and someone had assaulted him inside the holding cell.”
On the possible motive for the attack, Mr Glasgow said: “Khader Saleh had made a nuisance of himself and he needed to be taught a lesson.”
Jurors heard Dibbassey had admitted the killing but had said he acted in self-defence.
The prosecutor said: “Kalifa Dibbassey was waiting in his cell for Khader Saleh to arrive, he had armed himself with a knife that had been fabricated from a piece of metal.
“He was ready to use that knife the moment the cell door was shut and as soon as he had killed Khader Saleh he ran from the cell and hid in a cell on a completely different level.”
Mr Glasgow said all three men “played their part” in the death at the west London jail and it did not matter who wielded the weapon.
Wormwood Scrubs has an operational capacity of around 1,300 prisoners and at the time of Mr Saleh’s death, there were 1,188 inmates.
All three defendants have denied murder.