Two rappers were fatally stabbed and shot repeatedly in what jurors were told was a scene of "bloody carnage".
The Old Bailey heard Saydi Abu Sheikh, 23, and Zakariya Jeilani Mohamed, 31, were left dead or dying in a bedroom after the five-minute "revenge" raid in Ilford, east London, last October.
A third man was shot through the head but lived. Two more managed to escape.
Five men are accused of the double murder, two charges of attempted murder and perverting the course of justice.
Minutes after the attack in Henley Road, a white Mitsubishi Outlander, allegedly used by the attackers and containing a small pile of clothes, was set alight in nearby Ronnie Lane.
Opening their trial on Wednesday, John Price KC told how a resident had called 999 just after midnight after hearing a bang and seeing a car on fire.
Police and paramedics found a "scene of bloody carnage" when they arrived at the address a few minutes later, Mr Price said.
"In an upstairs room were two young men, both dead or dying. They had each been shot and stabbed many times," he said.
"A third young man, gravely wounded, had been left for dead. Though he sustained a gunshot wound which had passed through his head, he was to survive.
"It was later discovered that a fourth man had run from the back of the house when a group of attackers armed with guns had forced their way in.
"A fifth man was even more fortunate. Before the gunmen were able to force their way into the room, he had concealed himself between a bed and the wall. Almost miraculously, his presence there went undetected by the gunmen."
The prosecution alleges four men caught on CCTV cameras in Henley Road were the defendants Chibuike Ohanweh, 21; Ayaanle Ali Adan, 20; Mahad Gouled, 22; and Zakarie Mohamad, 19.
It is alleged the fifth defendant, Zain Mirza, 21, had "procured" the attack while careful to remain at "arm's length".
Mr Price said: "He was the one who most wanted it done. His motive was revenge."
Mr Ohanweh, of Romford; Mr Adan, of Barking; Mr Gouled, of Enfield, and Mr Mirza, of Newham, deny all the charges against them. Mr Mohamad, of Kensington, has admitted perverting the course of justice.
The trial continues.