Craig Levein celebrated his debut match in charge of Dundee United by watching his side fight back to record their first home League win of the season.
The deadlock was not broken until the second half
Levein's team went behind soon after the break when Charlie Adam sidefooted home Nacho Novo's cross from the left.
United equalised when Garry Kenneth met Barry Robson's corner at the far post with a firm downward header.
With eight minutes left, Lee Mair nodded in Craig Conway's cross to lift his side off the bottom of the table.
Despite dominating possession for the majority of the match, Rangers failed to capitalise on their advantage before they finally broke the deadlock in the second half.
The early exchanges gave every indication that the Ibrox side would run away with proceedings.
Striker Novo should have given Paul Le Guen's side the lead after four minutes but the ball got stuck between his feet before he stabbed out a shot that looped over the United bar.
A minute later, Barry Ferguson sidefooted wide from the edge of the area, having being given ample time by the United midfield to consider his options.
Novo had arguably the best chance of the first half but his turn-and-shot just outside the six-yard area from Alan Hutton's pull-back was screwed wide of Derek Stillie's right-hand upright.
Despite having little possession, Levein's tactics of packing five in midfield worked - at least until half-time.
During the interval, the new Tannadice boss chose to replace lone striker Collin Samuel with David Goodwillie.
Although, he employed the same tactics, United appeared to show more of an attacking intent after the restart. At first, it was to their detriment.
Loose play allowed Adam to steal the ball and play in Novo, who then crossed from the left to allow his team-mate to guide the ball past Stillie with a good finish.
It was the fourth goal in five games for Adam and he came close to making it five in five but his fierce drive from the edge of the area was tipped over by the United keeper.
Had that gone in, then game over. But for United it was a lifeline and they made Rangers pay when Kenneth headed in 13 minutes from time.
It sent the home fans, which included television presenter Lorraine Kelly, delirious with joy.
But not as delirious as they were five minutes later when Mair rose above his challengers to head in at the far-right post.
Dundee Utd: Stillie, Mair, McCracken, Kenneth, Kalvenes, Conway, Kerr, Cameron, Robertson, Robson, Samuel(Goodwillie, 46). Subs not used: McLean, Archibald, Duff, Easton, Burnett, Smith.
Goals: Kenneth 77, Mair 82.
Rangers: McGregor, Hutton, Papac, Hemdani, Smith (Sebo,86), Novo, Ferguson, Clement, Adam, Buffel (Kris Boyd, 67), Prso. Subs not used Klos, Rae, Bardsley, Svensson, Stanger.
Goal: Adam 50.
Referee: K Clarke (Scotland).