Gretna's lead at the top of the Second Division was cut to 11 points after a Chris Millar brace condemned the Borderers to their first defeat since Christmas Eve.
The game looked to be heading for a draw when Peter Weatherson's long ball forward was flicked on by Derek Lilley, for Millar to lift the ball over Alan Main in the 78th minute.
Millar's second came two minutes later - a simple close-range tap-in from James McAlistair's cross.
Gretna almost pulled one back a minute later, but James Grady's effort was kept out by the crossbar, with David McGurn beaten.
Morton should have made it three in the 84th minute when Weatherson played in substitute Jason Walker, but Main pulled off a good save and Weatherson's follow-up shot was blocked.
Kenny Deuchar reduced the deficit for Gretna with a shot that took a deflection off Weatherson to beat McGurn, but it was too little too late for Rowan Alexander's side on this occasion.
It was a lacklustre performance from the semi-final bound league leaders, but they should have taken the lead in the 10th minute but a great save by McGurn from Ryan McGuffie denied them, when the Gretna player looked certain to turn in Grady's cross from six yards out.
When Andy McLaren elbowed Gavin Skelton in the back the Gretna player's free-kick caused panic in the visitors box, but Derek Townsley could only lash an effort wide.