Billy Smith, 24, repeatedly stabbed Margaret Agnew, who was 69 at the time, in her home in Coatbridge, North Lanarkshire, in October last year. She had to undergo a life-saving operation.
The High Court in Glasgow heard Smith targeted the house because Mrs Agnew was continuing to associate with a man he believed was a paedophile.
That person was in the house that night.
Smith, from Airdrie in North Lanarkshire, admitted attempting to murder Mrs Agnew.
Judge Lord Mulholland told Smith: “This woman required an operation to save her life. Whatever your motivation, you are not entitled to take the law into your own hands.
“The law of the jungle does not apply in these courts. This lady had done nothing to you.”
Smith, who is assessed as a high risk of re-offending, was also ordered to be monitored in the community for three years after his release from jail.
His new sentence will start at the expiry of a 27-month sentence he is currently serving.
Smith was said to have been “unimpressed” that Mrs Agnew continued to be in contact with the man. The offender allegedly believed the man had abused children.
Prosecutor Owen Mullan said the OAP was attacked with a “knife or screwdriver-type implement”.
He said the crime appeared to be a “revenge attack” against the individual known to Mrs Agnew.
This person was staying with the pensioner that night. Smith broke into the house and said: “I am going to kill you both.”
Mrs Agnew ended up being severely hurt. She was initially struck on the shoulder before slumping to the ground and being hit again on the body.
Smith then fled, with police soon arriving at the property.
Mrs Agnew identified Smith as her attacker.
She suffered six wounds and needed 40 stitches. The OAP ended up losing three stone in weight as a result of her ordeal.
Mr Mullan: “Without surgical intervention, she would have died.” Smith smiled at members of his family as he was led away to prison.