The scoreline flattered Rangers with Robbie Crawford grabbing the final goal with almost the last kick of the ball after Montrose had twice been denied a late equaliser by the woodwork.
The hosts, who were unbeaten in six games, took the lead in the 16th minute through Lloyd Young but Lee McCulloch levelled six minutes later from the spot after Stephen McNally fouled David Templeton.
Dean Shiels set up Kevin Kyle and then finished off a break himself within two minutes midway through the second half, but Montrose substitute David Gray soon scored a superb lob to set up an exciting finale, during which both Garry Wood and Scott Johnston struck the frame of the goal.
Crawford sealed the league leaders’ sixth consecutive Third Division victory, but McCoist said: “We looked as if we were all over the place at times.”
Montrose boss Stuart Garden said: “We deserved something out of the game.
“They have quality but on the day we didn’t have the rub of the green.”