Livingston provided the Well with an early scare when Graeme Smith had to react well to tip Steve Hislop shot round the post after good work from Wes Hoolahan.
Having survived that, the first half was all Motherwell. hey should have been ahead after 14 minutes after Greg Strong had hauled down Scott McDonald for a stone-wall penalty, but Richie Foran's kick was well saved by Roddy McKenzie diving low to his left, and the Irishman could do nothing with the rebound.
'Well striker McDonald could have had a hat-trick by half-time, although he was unlucky to see a net-bound effort cleared off the line by Harald Pinxten, and then when he was clean through to see his shot slide just wide.
The goal did arrive just five minutes before the break when Jim Hamilton climbed over Dave MacKay at the back post to head a Martyn Corrigan cross powerfully past McKenzie for a deserved lead.
It could have been two, but Foran's header just scraped the bar on its way over.
Motherwell continued to dominate at the start of the second half with McKenzie producing a fine save to deny Hamilton. The visitors had to rely on the home side creating anything for them, and Smith was forced to save from a poor headed pass-back from Stephen Craigan.
Livingston turned the game on its head with 15 minutes left when a Colin Healy knock-down into the box was flicked past Smith at the front post by substitute Noel Whelan for an unlikely equaliser, proving the old adage that 1-0 is never enough.
Despite that there was to be a sting in the tail with 'Well sealing the points in the final minute. A Steven Hammell free-kick was only half cleared, and he knocked it back into the danger area. After a shot was half blocked, Brian McLean smashed his effort past the helpless McKenzie for three points that keeps'Well in the top six chase.