Stuart McCall's men had been enjoying an impressive March, with three wins and a draw in their four matches, but they came unstuck against a Kilmarnock side that had lost their previous two matches.
Iain Vigurs gave the hosts a 41st-minute lead as they looked set to pick up another three points, but the visitors rallied after the break.
Rory McKenzie equalised with 66 minutes on the clock and the match looked destined to end in stalemate before Craig Slater netted for the away side in stoppage time to secure an important win in their battle to finish clear of the relegation play-off places.
Motherwell, meanwhile, stay third and are three points ahead of Dundee United, with Aberdeen five points better off than McCall's men ahead of the last two games.
Thankfully for Motherwell, Dundee and Aberdeen could only draw 1-1 at Pittodrie.
Paul Paton got United off to a great start, scoring with just six minutes gone, but the hosts restored parity courtesy of a Niall McGinn goal just after the break.
Celtic were crowned champions last weekend and they suffered something of a hangover as they were held to a 1-1 draw at home to Ross County.
Kris Commons levelled after Melvin de Leeuw’s opener, but Neil Lennon's men were unable to push on and claim all three points, ending a run of four consecutive league wins, while County moved up a place to ninth.
Inverness and St Mirren had to settle for a point apiece from an entertaining 2-2 draw.
Jason Naismith put the visitors into the lead after only three minutes, but Inverness went into half-time with a 2-1 lead thanks to goals from Ross Draper and Greg Tansey.
Sean Kelly got St. Mirren's second and although Josh Meekings received a red card for the home side with 22 minutes to go, neither side could add to the score.
Partick Thistle left it late to salvage a point at St. Johnstone as they drew 1-1 at McDiarmid Park.
The hosts appeared set to claim all three points thanks to Stevie May's ninth-minute opener, but Kris Doolan netted for Thistle in the 90th minute, snatching a draw from the jaws of defeat.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.