Anthony Anderson was filmed urinating on Christine Lakinski
Anthony Anderson also covered Christine Lakinski with shaving foam after she collapsed in a Hartlepool street.
The 50-year-old, who suffered from a number of medical conditions, was later pronounced dead at the scene.
Anderson, 27, and from Raby Road in the Teesside town, had earlier admitted outraging public decency.
The court heard how, on 27 July, Miss Lakinski was making her way home with a box of laminate flooring when she fell ill and stumbled into a doorway.
Anderson, a former soldier, had smoked a cannabis joint and been drinking when he and two friends spotted her.
He tried to rouse her by throwing a bucket of water over her, before urinating on her and covering her with shaving foam.
A crowd had gathered around, watching and laughing, and the incident was filmed on a mobile phone.
She was later declared dead at the scene, the cause of death being given as pancreatic failure.
Magistrates in Hartlepool had referred the case to Teesside Crown Court so a longer jail term could be handed out.
Judge Peter Fox, the recorder of Middlesbrough sitting at Teesside Crown Court, said: "You violated this woman in an incredible way, and the shocking nature of your acts over a prolonged period of time must mean that a prison sentence of greater length is appropriate in this case."
'Sick and inhumane'
Outside court, Miss Lakinski's family said in a statement: "We remain totally shocked that anyone could behave in such an appalling way.
"The fact that Christine was dying makes this man's actions even more sick and inhumane.
"However, those who stood by and did nothing to stop Anderson are also guilty in our eyes.
"It beggars belief that these people chose not only to condone his cruelty, but also to walk away from a neighbour who was clearly in distress and needed help."The family statement added that Christine had "faced immense challenges throughout her life", yet still had managed to "forge an independent life for herself".