Stephen Savage, 38, ambushed the father of another five-year-old boy he blamed for making his son cry and lashed out with a knife.
Victim William Punshon, 38, suffered 13 stab wounds and later received an apology from police, who admitted they had ignored warnings that Savage had threatened to strike.
Savage, of Hamilton Road, Broomhouse, Glasgow, was accused of attempted murder after the stabbing outside the primary school in Glasgow on January 20.
In court his guilty plea to a reduced charge of assaulting Mr Punshon to the danger of his life was accepted. He also admitted making threats to the victim's wife Julie Punshon, 43, earlier that day.
Sentencing him at the High Court in Edinburgh, judge Lord Bracadale told Savage: "Your conduct at the school gates was bad enough. What you did in the afternoon is of a completely different order."
Savage sat in the dock as defence advocate Allan Macleod told the court: "The red mist came down."
Mr Macleod told how Savage, lacking a father-figure in his own life, had become an over-protective parent. He thought his son was being bullied and the school were not doing enough about it. The lawyer said Savage took a knife to school because he was afraid of Mr Punshon but had not intended to kill or injure anyone.
"When he saw Mr Punshon that afternoon he saw red. He described the red mist descending," said Mr Macleod. He added: "He realises now that this behaviour was disgraceful."
Advocate depute Murdo MacTaggart, prosecuting, told how the Punshons drove to the school in the afternoon to pick up their son. Mr MacTaggart said a black car drove up at speed and blocked the road.
Savage got out and forced his way into Mr Punshon's car as he was trying to lock the door.
"Without any provocation, the accused began striking William Punshon," said the prosecutor.
Mr Punshon was stabbed in the thigh as he tried to disarm his attacker. Blood was running down his face as he was repeatedly struck with the knife.
"William Punshon believed at that time that he was going to die," said Mr MacTaggart.
School staff and neighbours witnessed the vicious attack, which left Mr Punshon fighting for breath because of bleeding into his chest.
Mr MacTaggart said Mrs Punshon had reported Savage's threats to stab her husband to the police and to the school.
Superintendent Eddie Smith, of Strathclyde Police, said: "It is our job to keep people safe and this involves trying to stop crimes before they happen. Despite our efforts, in this instance we did not do that.
"We have met the family and have apologised."
Contextual targeting label: