Paul Quinn, 35, and Thomas Stevenson, 34, broke into Philip McDermott's home in Stevenson, Ayrshire, in May 2012.
The High Court in Edinburgh heard how the pair were wearing masks when they forced the 70-year-old to give them £300 so they could buy drugs.
They threatened to hit Mr McDermott with a hammer during the ordeal.
Mr McDermott - who was left traumatised by the attack - died in hospital the following day due to heart and lung disease.
The court heard the robbery was "very upsetting" for Mr McDermott.
The same incident came just weeks after Quinn - who stayed in the same flats as the man - stole from his own mother.
The pair originally faced a charge of culpable homicide but prosecution lawyers dropped the charge because they couldn't prove the attack directly caused Mr McDermott's death.
Jailing Quinn for six years and four months and Stevenson for six years and nine months, judge Lord Pentland branded them "cowardly" and "despicable."
Ordering they both be supervised by the authorities for four years following their release, Lord Pentland added: "Your cowardly and despicable behaviour unsurprisingly caused the complainer great upset."