Christopher Long fired Motherwell into the lead two minutes into the second half but that was cancelled out by a penalty from Steven Lawless.
It was Lawless' first touch as he replaced Keaghan Jacobs when the penalty was awarded, and he made no mistake from 12 yards.
But in a frantic finish Campbell struck to give all three points to Stephen Robinson's side.
Robinson has been heavily linked with the vacant manager's job at Hearts but Motherwell fans will be hoping he stays where he is as he continues to keep them flying high in the league.
Livingston were first to threaten when Motherwell goalkeeper Mark Gillespie parried a cross into the path of Scott Tiffoney but he was then helped out by his defence as Declan Gallagher produced a great block to divert the striker's shot over the crossbar.
Liam Donnelly has been in a rich vein of goal-scoring form for Motherwell this season and the midfielder tried his luck from distance, but Livingston's Marvin Bartley was positioned in the right place to block his goal-bound effort.
Tiffoney threatened again for Livingston when he evaded a couple of challenges to make space and then let fly with a low drive from the edge of the penalty area that Gillespie did well to turn round a post.
Livingston defender Jon Guthrie was booked on the half-hour mark for abruptly halting Jermaine Hylton's burst forward with a block.
Motherwell forced Livingston goalkeeper Matija Sarkic into a fine stop after 37 minutes when Devante Cole laid the ball into the path of Christopher Long and his well-struck shot from the edge of the penalty area was turned round a post.
Well keeper Gillespie got lucky when he came for and missed a Jacobs free-kick but he was helped out by his defence, who scrambled the ball clear.
Just 120 seconds into the second half Motherwell made the breakthrough through Long, although the Motherwell striker was given a huge helping hand by Livingston goalkeeper Sarkic.
It was a swift attack from the Steelmen as Peter Hartley played it out from the back to Jake Carroll and found Liam Polworth.
Polworth then played the ball out to Long, who had drifted out to the right flank, and the striker made his way into the penalty area and then fired in a low shot.
It should have been gathered by Sarkic but he allowed the shot to slip through his grasp and over the line.
Livingston drew level on the hour mark with a Lawless penalty after Cole had barged into the back of Tiffoney.
As soon as referee Euan Anderson pointed to the spot, Livingston opted to make a substitution as Lawless replaced Jacobs and the winger grabbed the ball, ran to the box, placed it on the spot and then fired it past Gillespie.
But with seven minutes remaining Motherwell won it as Polworth's shot was blocked but deflected into the path of the unmarked Campbell and he slotted it home.