Burton O'Brien capped a man of the match performance with a spectacular long-range strike to boost Livingston's hopes of survival.
The midfielder stuck four minutes after the break to clinch all three points for Livi and drag Dundee back into the relegation scrap.
The Dark Blues pressed hard for an equaliser and Eric Deloumeaux cleared a Stuart Lovell effort off the line to ensure Livi finished ahead.
In fact they should have ended the match two goals to the good, but Colin McMenamin wasted a glorious late opportunity.
Livi started strongly and could have taken the lead inside ten minutes when Gabor Vincze was presented with a chance from the edge of the box, only to miss the target.
Visiting goalkeeper Roddy McKenzie then kept the scores level by stopping John Sutton's effort, before Lee Wilkie headed a Steve Robb corner over when well placed.
Richard Gough's men should then have had a spot-kick when Robb bundled over Jason Dair inside the area, but the referee was not interested.
In the 49th minute O'Brien drove forward before unleashing a rocket from 25 yards that flew beyond Dundee keeper Derek Soutar's dive and into the corner of his goal to put Livi in control.
Soon after Fabian Caballero created a chance for Lovell to level, but he could not get a foot on the Argentinian's low cross.
Deloumeaux then cleared Lovell's shot off the line after McKenzie failed to claim a cross, but the keeper did better a minute later as he punched Callum McDonald's centre clear before Sutton could get his head to it three yards out.
And with that the Dark Blues' hopes were over and they now sit just two points above rock-bottom Livingston and neighbours Dundee United.