Amjad Khan, 32, was resuscitated at Yardley Close, in Oldbury, after he was allegedly attacked by Damon Sehra, 23, and his uncle Derek Brennan, 33, last year.
The emergency services managed to restart Mr Khan's heart within 10 to 15 minutes after the attack on June 8, Wolverhampton Crown Court heard.
Both defendants are standing trial accused of Mr Khan's murder.
The case so far:
Sehra, of no fixed address, has admitted manslaughter on the grounds of diminished responsibility. Brennan denies both charges.
Mr Khan, from Handsworth, was allegedly attacked by both defendants after arriving at the flat, belonging to Lisa Sehra, the mother of Damon and sister of Brennan, at 12.41am that morning.
The judge, Mr Michael Chambers QC, told the court: "Amjad Khan arrived at the QE [Birmingham Queen Elizabeth Hospital] emergency department at 1.30am in the morning.
"He had suffered cardiac arrest at the scene from a very traumatic injury. Pulmonary resuscitation started and [emergency services] received a heart beat after 10 to 15 minutes."
At hospital, medical staff found there was injuries to Mr Khan's head and face including swelling to his scalp and left eye.
A CT scan showed there was also swelling to his brain. Mr Khan died on June 13, five days after the alleged attack by Sehra and Brennan.
The trial continues.