Andrew Fowler and Amanda Moran were sentenced after admitting the manslaughter of Stephen Eastwood, who died from his injuries in hospital more than two years after being attacked in March 2012.
Police said the death of the victim, who led a life “plagued with drug abuse, alcohol abuse and homelessness”, was a “stark reminder of the evils of drugs and the lifestyle they fuel”.
Mr Eastwood, who was 45 at the time of the attack, was left with serious injuries and found unconscious inside a derelict garage on Lawrence Street, York.
According to North Yorkshire Police, he and the defendants were regular drug users and often slept at the disused garage which was frequented by several other homeless people.
The victim – also known as Tiv - was attacked during an argument over drugs. Moran and Fowler had given him money to buy heroin and were angry when he failed to deliver what they were expecting.
An argument flared up and both defendants followed Mr Eastwood into a room in the garage where the argument continued.
Both defendants later emerged from the room, but the victim did not and was later found with serious injuries, bleeding and barely conscious.
Mr Eastwood was taken to York District Hospital and never recovered from his injuries. He remained in hospital until May 2014, when he sadly died at the age of 47. The cause of his death was pneumonia, which was a direct consequence of his head injury.
Fowler, 43, previously of Monkton Road, York was jailed for seven years and Moran, 29, of Malvern Grove, Beeston, Leeds, was jailed for six years at Leeds Crown Court. They pleaded guilty to manslaughter earlier this month.
Detective Chief Inspector Allan Harder of North Yorkshire Police, said: “This was a callous and brutal attack against a vulnerable man by two people who initially denied any involvement in the assault.
“No-one deserves to die in these circumstances, let alone at the hands of people they regarded as ‘friends’.
“It is a tragic story of someone who led an already difficult life, plagued with drug abuse, alcohol abuse and homelessness, who ended up losing his life as a result of an argument over heroin. It is a stark reminder of the evils of drugs and the lifestyle they fuel.
“I hope the sentence handed out today gives Fowler and Moran ample time to reflect on their vicious and cowardly attack on Stephen and the tragic consequences of their actions.”