In the first match between the two clubs in 93 years, The Wasps had led through Jonathan Tiffoney’s first-half header until Templeton pounced with six minutes remaining, but Ally McCoist’s men could not find a late winner and lost further ground on leaders Hearts.
Rangers received a swift warning when Steve Simonsen kept out a shot from Stephen Simmons, but they should have snatched an early lead as Kris Boyd sent a half-volley over the bar.
Boyd and McGregor then went close with headers as the Gers continued to press, but the visitors were left stunned when Mark Docherty’s cross was nodded into the net by Tiffoney (35).
This setback failed to stir the visitors and they only managed a wayward header from Bilel Mohsni before the break.
The wasteful Boyd sent another header over the bar in the second-half, but Simmons could have extended Alloa’s advantage when he glanced wide of the post.
Gaps were being left at the back by the increasingly desperate Light Blues and they received a further let-off when Greig Spence shot at Simonsen.
But Templeton rescued Rangers by poking home a loose ball and they were denied a late winner when Jon Daly’s effort was ruled out for offside.