A last-minute Nikolay Todorov strike rescued a point for Queen of the South after they had blown a two-goal advantage for the second game in a row.
The Dumfries side appeared to be cruising to victory after goals from Joe Thomson and Lyndon Dykes.
However, Rafa De Vita threw Livingston a lifeline before goals from Craig Halkett and Ryan Hardie completed the turnaround, putting the West Lothian side 3-2 ahead.
Hardie had another effort controversially ruled out for offside just before Todorov’s last-ditch effort ensured a share of the spoils.
Livingston manager David Hopkin was far from amused at the offside decision. “I thought it was embarrassing that the linesman ruled out Ryan’s strike to make it 4-2,” he said.
“None of their players called for offside and the officials couldn’t give me a straight answer. There should also have been a red card for an elbow but he hasn’t given it. Referees cost you points.
“I had a go at the players at half-time but they came out and responded. I think we should have seen the game out.”
The afternoon started positively for the hosts when Thomson arrowed home a brilliant strike following a Stephen Dobbie pass.
If the home fans were happy with the opener, there was a sense of jubilation less than a minute later when Dykes doubled the advantage. Dom Thomas raced down the right flank before cutting the ball back for Dykes to touch beyond a hapless Neil Alexander.
Despite the deficit, Livingston looked dangerous going forward and deservedly pulled one back five minutes before the break, De Vita curling a delicious free-kick into the bottom corner following a foul on Lee Milller.
There was a sense of deja vu after being pegged back from two goals up in midweek to Dundee United when Halkett equalised, the Livingston captain rising highest to head home Alan Lithgow’s long throw on 52 minutes.
Livingston looked on course for all three points when Hardie, on as a substitute less than 24 hours after completing 90 minutes for Scotland’s Under-21s in Andorra, put them ahead.
The on-loan Rangers striker met Miller’s cross with a stooping header that evaded the clutches of Jack Leighfield only three minutes after his introduction.
Hardie had another strike ruled out for offside before Queens took advantage of the reprieve when Todorov fired home in the 90th minute after Alexander had produced a brilliant save to deny Thomson.
Hopkin added: “Ryan was desperate to play and great credit to the boy. It shows me everything about his character and how he wants to play for Livingston and me.”
Gary Naysmith, the Queen of the South manager, said: “Given how the game went, I’m very happy to get a point in the end but I still feel as though we have thrown two points away.
“We did well to keep going because we had nothing left in the tank after a tough spell and that point might prove to be very important.”