Rolando Zarate struck three minutes from time to complete a perfect Christmas period for Livingston as he took advantage of an error in the Motherwell defence.
The Argentinian struck in the 87th minute to gift Livi their second successive victory as Motherwell failed to build on their shock Boxing Day win over Premier League leaders Rangers.
The three points earned by the former Velez Sarsfield forward also saw Livi open up a seven-point gap on bottom club Dundee United.
But the late Zarate winner was cruel on the visitors who deserved a draw for their efforts at the City Stadium.
However, the late Livi goal should have been avoided after Well player Steven Hammell elected to shield the ball from Michael Hart instead of clearing to safety.
Livewire Hart capitalised by racing for the by-line and then sending the ball across goal for Zarate to tap home at the near post.
Motherwell had started in positive mood with James McFadden and Derek Adams both having decent attempts at goal inside the first 10 minutes.
Livingston threatened for the first time through midfielder Francisco Quino who sent a 20-yard half-volley into the side-netting.
Both Davide Xausa and Zarate also had shots saved by in-form Well goalkeeper Francois Dubourdeau.
Defender William Kinniburgh lost the ball and, just as Xausa was about to race in on goal, Martyn Corrigan read the situation to perfection to quickly clear.
Quino then played a clever ball over the top of the visitors' defence but Dubourdeau ran from his line to dive at Juanjo Camacho's feet.
With just eight minutes of the first half remaining, Adams latched onto a precise Hammell cross but his shot was tipped over by Javier Sanchez Broto.
Then Stephen Pearson headed narrowly wide form Hammell's excellent free-kick from the right.
A tactical alteration by Livi at the break saw Oscar Rubio replacing Phillipe Brinquin.
Andrews latched onto a long kick from Broto and headed against the upright before seeing his shot on the rebound saved by the keeper's feet.
Quino then shot just wide before David Bingham had a goal chalked off for a foul on the keeper.
Then, Xausa's through ball just had too much pace which allowed the keeper to smother the ball to prevent Camacho scoring.
With 16 minutes left, Well skipper Scott Leitch showed great vision to switch the play and found McFadden but the striker's first touch was poor and stopped him going clear.
Broto then brilliantly blocked substitute Steven Ferguson's close range effort after the sub latched on to Corrigan's deflected shot.
However, with time running out, Zarate made a turn and then had a decent shot on goal from the edge of the box which the keeper held.
But, just as a share of the points seemed likely, Motherwell conceded a goal at the very end.
Hammell allowed Hart to get to the by-line and his precise cross was slotted home by Zarate.
Teams
Livingston Broto, Brinquin (Rubio 46), Andrews, Hart, Bollan,
Quino, Makel, Bingham, Xausa (McMenamin 78), Zarate,
Camacho (O'Brien 72).
Subs Not Used: McEwan, Toure-Maman.
Booked: Xausa, Bingham.
Goals: Zarate 87.
Motherwell Dubourdeau, Corrigan, Kinniburgh (Clarkson 90),
Partridge, Hammell, Cowan (Ferguson 67), Adams, Leitch,
Pearson, Lehmann, McFadden.
Subs Not Used: Woods, Ramsey, Fagan.
Booked: Hammell, Adams, Pearson, McFadden.
Att: 7,216
Ref: C Thomson (Scotland).