Steven Naismith scored the first of his brace with a spectacular strike from 15 yards after a poor defensive clearance.
Gary Hooper restored parity with a neat finish and that is probably how it would have stayed until the break but Gers stopper McGregor allowed Badr El Kaddouri's long range drive to slip past him to give the visitor’s the lead.
Deep into time added Naismith scored his second of the afternoon to continue Rangers unbeaten start to the campaign and give manager Ally McCoist his first Glasgow derby win.
Referee: Craig Thompson
Yellow cards: Wilson (CEL)
Red card: Mulgrew (CEL)