New Livingston signing Paul Dalglish saved the blushes of the SPL club with a 69th-minute winner at Raith Rovers in the CIS Insurance Cup second round.
The Second Division side had taken a shock lead when Paul McManus' mis-hit cross floated over Livi goalkeeper Roddy McKenzie and into the net.
But Jason Dair volleyed in the equaliser nine minutes after the break.
Dalglish secured the win when he put the ball through keeper Alistair Brown's legs.
Things had looked bleak for Livi within the first five minutes when manager Paul Lambert hobbled off with a thigh strain.
But Raith still had Brown to thank for keeping the scoreline down. The 19-year-old dived full-length to turn aside Dave Mackay's curling effort and then acrobatically tipped Scott Boyd's net-bound header over.
The Stark's Park side then rocked the visitors in the 44th minute when McManus' cross eluded McKenzie and hit the back of the net.
There was a scare for Livingston only minutes after the interval as skipper Mackay almost miscued Brian Fairbairn's cross into his own net from close range.
But the SPL side survived to snatch the equaliser in the 54th minute. Paul Tierney's run from the back almost brought dividends as his shot crashed down off the crossbar, but the subsequent corner brought the goal.
The home side failed to clear the danger and, as the ball shuttled its way to Dair, the former Raith player chested down and volleyed home from 12 yards.
Fifteen minutes later, Dalglish took the ball in his stride before nut-megging Brown to take the sting out of Raith's resistance.