Rangers blew the chance to move 22 points clear at the top of the Irn-Bru Third Division after being held to a last-gasp draw by Montrose at Ibrox.
An own-goal from John Crawford had looked enough to secure the win in the only match to survive the weather conditions in Scottish football's bottom tier.
But the final say went to David Gray when he lashed home with 89 minutes on the clock to claim a share of the points for the visitors.
Rangers boss Ally McCoist made one change from the side who won at Peterhead last week, with Dean Shiels drafted into the starting line-up and Ian Black dropped to the bench.
Goalkeeper John Gibson and Martin Boyle both started for the visitors after joining on loan from Dundee.
Montrose looked lively early on and had a crack at goal when Boyle's cross found Scott Johnston unmarked but his effort was claimed by goalkeeper Neil Alexander.
At the other end, Francisco Sandaza's cut-back was collected by Shiels but his shot deflected wide of the near post and Rangers failed to capitalise on the resulting corner.
The Spaniard was the provider again, this time for Andy Little, but Gibson did well to smother at the feet of the Northern Irishman who took too long to unleash the shot.
Montrose still looked capable of causing problems and Leighton McIntosh was not too far away with a bullet header that fell across goal and wide.
There was concern for Rangers when Lewis Macleod went to ground following what appeared to be an innocuous challenge from Paul Watson.
The youngster left the pitch on a stretcher and was replaced by Black after 29 minutes.
The former Hearts man set up Templeton in front of goal but the winger's header was just off-target.
The breakthrough finally came on the stroke of half-time when Templeton unleashed a left-foot shot that appeared to be directed into the back of his own net by Crawford under pressure from Little.
Rangers could have doubled their advantage shortly after the break when Lee Wallace's free-kick was met by Little and he fired just over the crossbar.
Ibrox then fell silent after 54 minutes for a piper's lament in memory of the supporter who lost his life at the last home game.
There was another change for the hosts after an hour when Chris Hegarty, who appeared to be struggling, made way for the introduction of Sebastien Faure.
Shiels then saw an acrobatic effort blocked in the packed goalmouth as Rangers tried to add to their slender advantage.
It proved to be the Northern Irishman's last real contribution when he was swapped for Barrie McKay with 15 minutes to go.
Gibson came to the rescue for Montrose twice in quick succession, producing an excellent save to deny Sandaza, before punching a McKay effort to safety.
Black's free-kick then crashed off the post, before Garry Wood passed up a great chance for a late leveller when he blasted over.
The honours went to substitute Gray instead who stunned the majority of the 46,273 crowd with a 25-yard strike that found the back of the net via the underside of the crossbar with a minute to go.