David McCraw, 46, had claimed that an intruder was behind the attack.
He told police he had been out at the shops for 10 minutes and returned to find Anne Reed covered in stab wounds.
Ms Reed had earlier begged McCraw to stop the knife attack and repeatedly told him she would tell officers a burglar was responsible.
McCraw continued his story at a police station in Edinburgh but when the victim arrived at hospital she named him as her attacker.
The unemployed bricklayer admitted attempting to murder Ms Reed at their former home in Muirhouse Gardens, Edinburgh, on 19 July last year.
He grabbed her by the hair, repeatedly struck her on the head and body with a knife and repeatedly kicked her to her severe injury, permanent disfigurement and to the danger of her life.
The High Court in Edinburgh heard one of the knife wounds inflicted on the 46-year-old victim went into her liver.
At an earlier hearing advocate depute Leanne Cross told the court the three-year relationship had been volatile and at times violent.
The night before the murder bid Ms Reed stayed overnight with a female friend before returning to the home at Muirhouse Gardens where she found McCraw in the living room watching television.
Ms Cross said: "He appeared to be heavily intoxicated, in a foul temper on account of not being able to get the telephone connected properly and he was verbally abusive."
Ms Reed went upstairs to give him time to calm down and could hear him in the kitchen and assumed he was making something to eat.
She came back downstairs but McCraw became verbally abusive towards her again and then jumped up, took hold of her hair and began striking her with a knife.
"She felt blood running down her face and neck and she curled up into a ball and screamed at him to stop," said Ms Cross.
But McCraw continued to knife her and kicked her as she lay on a sofa.
The victim believed that she blacked out and McCraw called for an ambulance.
Police spoke to Ms Reed briefly before she was taken to hospital and she told them an intruder was responsible for her injuries.
Defence solicitor advocate Robbie Burnett said it was not "one-way traffic" in the volatile relationship between the couple.
He said: "McCraw was devastated when he realised what violence he could be capable of and he has apologised to the complainer."
Mr Burnett told the court he had spoken with Ms Reed and she had written to the court saying she felt McCraw had "every remorse" and that she wished to continue the relationship.
Judge Lord Uist today told McCraw: "You pleaded guilty to the very grave crime of attempted murder with a knife on the woman who you were living with.
"The attack was appalling in nature involving the repeated use of a knife.
"She sustained multiple stab wounds one of which caused the laceration and bleeding of her liver.
"Fortunately the attack did not prove fatal in nature although that was a matter of pure chance."
The judge told McCraw, of Muirhouse View, Edinburgh, drink was no excuse for what he did.
He also ordered that McCraw be on a licence for three years after he has served his prison sentence and added that the jail term would have been seven years had he been convicted after trial.