Gretna 4 Kilmarnock 2
Goals from Nicky Deverdics, Rhys Meynell, Craig Barr and Mickael Buscher put them four up before Killie staged a late rally.
The win moves Gretna to within nine points of second-bottom Kilmarnock with a game in hand.
Incredibly, Gretna were 3-0 up at half-time as Kilmarnock were left shell-shocked.
Kilmarnock started strongly and, within the first few seconds, Simon Ford sent a header over the top from Garry Hay's free-kick.
But Gretna hit back and the dangerous Buscher tested Chad Harpur with a well-struck shot from distance which the goalkeeper dealt with well.
Gretna snatched the lead after 27 minutes with a superbly-taken goal from Deverdics. He spun on the edge of the penalty area before volleying home an unstoppable left-foot shot that gave Harpur no chance.
Gavin Skelton was next to try his luck but Harpur was well-positioned to save as Gretna showed they were not content simply to defend their lead.
Six minutes from the break, Gretna went 2-0 in front. Meynell met a John Paul Kissock corner to flick the ball home and take advantage of Kilmarnock's slack defending.
Worse was to follow for Kilmarnock and, on the stroke of half-time, Barr put Gretna three up with a header in spite of Fraser Wright's attempt to hack it off the line.
Kilmarnock tried to hit back before half-time but Greg Fleming touched a header from Danny Invincibile away for a corner.
It was Gretna that went further ahead in the 59th minute when Meynell picked out Buscher 14 yards out and he slammed the ball past Harper.
Substitute Henry Makinwa then tested Harper with a 22-yard shot but the goalkeeper was equal to the task.
Ford pulled a goal back for Kilmarnock from Willie Gibson's cross after 71 minutes and Jim Jefferies' side stage a late fightback.
Gibson scored their second with a right-foot shot from the edge of the area but it was far too little too late.