Describing the motive for the killings as 'absurd', Martin Heslop, for the prosecution, said members of the gang turned the flat into a death trap, to try to ensure that no one would escape.
The front door of the flat, in Plaistow, was set alight to prevent the 11 occupants from fleeing before a petrol bomb was hurled into the living room. As the flat caught fire people tried to flee, some scrambling across the roof, others leaping from the second-floor windows.
Mr Heslop said two men did not make it. Dean Redway, 20, finding himself trapped, managed to get to the bathroom, filled the bath and lay covered in water in an attempt to protect himself from the flames, but he died of smoke inhalation.
A second man, Ade Oki, 19, died on the second floor landing. The jury was told that his body was unrecognisable as a result of the fire.
'The incidents arose between the defendants and their friends, who are predominantly West Indian, and the occupants of that flat, who are predominantly Nigerian,' Mr Heslop said.
'These two groups seem to have been drawn into this violence over something absurd like the theft of a bracelet and the loss of face involved at a party two weeks earlier.'
Pa Njie; Mark Whyte, 21; Brett Ingram; Keith Thomas, 20, and Ian Maynard, 20, all from Clapton, east London, each deny two charges of murder on 5 December last year. Mr Njie, Mr Whyte, Mr Thomas, Simon Ingram, 21, from Clapton, and Joel Pilgrim, 20, also from Clapton, deny violent disorder at the party two weeks earlier.
Mr Whyte, Mr Thomas and Pilgrim face further charges of aggravated burglary at the flat.
The trial continues today.