Former Dundee United midfielder Craig Easton sent Dundee into the first division and preserved Livingston's SPL status.
Easton produced a rare headed goal after 26 minutes to equalise Callum McDonald's opener to earn his side the point they needed and deprive Dundee of the three they required.
Livingston had their backs to the wall in a frantic final spell which saw a Tom McManus shot strike the outside of the post in injury-time.
It was cruel on Dundee but Livingston played the more thoughtful football throughout and merited their moment in the sun.
Livingston showed signs of nerves after only 15 seconds when Eric Deloumeaux was short with a headed back-pass and McManus pounced.
But Roddy McKenzie was off his line quickly to shut down the angle and divert the ball for a corner.
Dundee made all the early running and Steve Lovell fashioned a shooting opportunity for himself with a clever turn but his final effort slid well wide.
Livingston had an early chance on the break when Burton O'Brien sent Easton scampering clear but his final pass in search of Hassan Kachloul was short and a good opportunity was lost.
Within a minute, Dundee had opened the scoring. Stephen McNally's looping ball into the area was headed back across goal by Bobby Mann and MacDonald lashed the ball home at the back post.
Neil Barrett then sent a shot high over the top as Dundee sought to kill off Livingston while they were still licking their wounds.
But the home side came back strongly and equalised after 26 minutes with their first attempt on goal. Kachloul weighted his cross perfectly for Easton to head the ball into the net at the far post.
The goal spurred Livingston and they almost snatched the lead three minutes later.
A speculative shot from Colin McMenamin from the edge of the area was left by Derek Lilley and the ball deceived Derek Soutar and came back off the post.
Kachloul tried to take advantage of the loose ball but it fell behind him and he could get no power in the follow-up shot.
O'Brien pulled the strings in midfield as Livingston looked the more likely to score again before half-time.
But they also hit card trouble with Gustavo Bahoken, Gabor Vincze and Kachloul all booked before the interval.
Bahoken was stretchered off after 57 minutes after a clash of heads with Iain Anderson that led to a lengthy delay.
The home side were first to threaten in the second half. O'Brien's low 25-yard shot was deflected narrowly wide after a short free-kick from Easton.
From the resultant corner, Manu Dorado volleyed just a yard too high as Dundee struggled to clear.
Kachloul had another attempt from distance but it sailed wide of Soutar's right-hand post.
Some slack defensive play from Sancho gave Kachloul a chance but the angle was too tight and Soutar blocked the ball with his foot.
Soutar then made another good save to hold a long-range effort from O'Brien before he held a chip from Kachloul.
Dundee pressed at the end and were unlucky when McManus' shot struck the post.