Jim McIntyre scored his fourth goal in as many days to secure victory for Dundee United with a late header and move them ever closer to a place in the top half of the Bank of Scotland Premier League.
Both sides contributed to a pulsating 90 minutes which had looked to be heading to a draw when substitute Collin Samuel scored with only 11 minutes left to cancel out Scott McLaughlin's second half-goal for the Lions.
Jason Scotland and new international recruit David McNamee both netted as the first half was locked at 1-1.
However, McIntyre had the final say when he climbed highest in the box to nod home the decisive goal.
The home side had started brightly despite their recent hectic schedule, and created an early opening when on-loan Celtic striker David Fernandez made space for himself on the edge of the box, but could not get his shot away.
United steadied themselves after this early warning and went close themselves, with a powerful 25-yard drive from Trinidad frontman Scotland going just wide over after five minutes.
But he did not have to wait long to get his name on the scoresheet.
After 13 minutes, midfielder Charlie Miller stood with his back to goal on the 18-yard line and, having spied his team-mate's intelligent run into the penalty box, slotted a cute back-heel through a number of players into his path.
Scotland, very much a bit-part player at Tannadice this season, demonstrated maturity beyond his years and experience as he let the goalkeeper stand tall for as long as possible before rolling a shot beyond him.
Losing the opening goal deflated Livi and it took them a full 10 minutes to recapture some of their early rhythm.
And when they did, Paul Gallacher was ably protected by his defenders, who stood firm in the face of a series of corners on the half-hour mark.
McNamee went closest with a little flick at the front post, but Alan Archibald bravely threw his body in the way.
He only had eight minutes to wait to see an effort hit the net, however.
First United thought they had doubled their lead after Miller raced through onto Mark Kerr's flick and sent the ball spinning past Roddy McKenzie. But, as he turned away to celebrate, Marvin Andrews raced in to nick the ball off the line.
Having committed men forward, the visitors were left stunned as the Lions raced up the other end of the field and set up McNamee to beat Gallacher from 18 yards.
Play swung from end-to-end and it was United who almost snatched the advantage at the interval when Andy McLaren volleyed on target, but McKenzie cleared with his feet.
McIntyre looked to build on the hat-trick he scored against his former side Kilmarnock, at the weekend, but missed the target from 12 yards out three minutes after the break.
Fernandez's return from Parkhead has been a major factor in Livi's good season, and he showed his worth to the side at the start of the second half.
In the 61st minute, he turned young defender David McCracken on the edge of the box, before making space to shoot.
But Gallacher showed strong hands to take the sting from the ball and clutch it to his chest.
Livi passed up a glorious chance to take the lead in the 69th minute when Fernandez and Derek Lilley combined to set up the ex-Tannadice man with an open goal.
Lilley, scorer of 13 goals this season, had raced into the penalty area to keep up with play, but could not stretch his leg far enough to get a clean contact on the ball and turn it into the net.
They were not denied on 72 minutes, though, as substitute McLaughlin dispatched a stunning right-foot volley past Gallacher's right hand to give the West Lothian side the advantage.
United brought Samuel on for his Caribbean team-mate with 13 minutes remaining and got an immediate return for their alteration - with two goals in as many minutes to give them the lead.
First Samuel found a loose ball inside the penalty area and planted an unstoppable right-foot shot underneath the body of the Livi goalkeeper.
Then, with the clock running down, McIntyre leapt above everyone in the penalty area to get to McLaren's cross before sending a header glancing beyond McKenzie into the far corner.
Teams
Livingston McKenzie, Rubio, Andrews, Dorado (McGovern 45),
McNamee, Makel, O'Brien, Lovell (McLaughlin 66), McAllister,
Lilley (McMenamin 87), Fernandez.
Subs Not Used: Main, Brittain.
Booked: McNamee.
Goals: McNamee 38, McLaughlin 72.
Dundee Utd Gallacher, Wilson, Innes, McCracken, Archibald,
Kerr, Miller, McInnes, McLaren, Scotland (Samuel 78), McIntyre.
Subs Not Used: Jarvie, Dodds, Duff, Easton.
Booked: McCracken, McInnes.
Goals: Scotland 13, Samuel 79, McIntyre 82.
Att: 3,082
Ref: C Richmond (Scotland).