Nacho Novo came back to haunt Dundee with two late goals for the visitors just as the home team looked to be heading for a share of the spoils.
The first goal attempt came from Dundee's Glen Larsen but his tenth minute effort flew high over the crossbar.
Moments later a great last-ditch tackle by Jonay Santos Hernandez denied Chris Burke a close-range shot at goal after a fine cross-field pass by Robert Malcolm.
Midway through the first half Dundee's Iain Anderson fired a 20-yard effort just past the post.
The same player went even closer to opening the scoring five minutes later but his fierce 20-yard shot was well-saved by Stefan Klos.
A minute later Jean-Alain Boumsong saw his 20-yard drive saved by Derek Soutar in the Dees goal.
Stephen Hughes and then Burke both saw shots go narrowly past the target before a low drive by Malcom was gathered at the second attempt by Soutar ten minutes before half time.
Larsen then had a shot on the turn easily saved by Klos and a minute later was unlucky when his 15-yard strike hit the outside of a post.
Neil Barrett caught Rangers by surprise 12 minutes after the break when he sneaked in unnoticed at the back post but he could only hit the outside of the upright from almost on the byline.
With 25 minutes to go Novo came on for Shota Arveladze and was greeted by a chorus of boos from the fans who worshipped the ground he walked on only months previous.
Moments later a crunching but fair tackle by Brent Sancho left the little Spaniard in a heap.
However with 12 minutes remaining, Novo was wheeling away in celebration after he knocked the ball into the net from three yards out after Burke had set him up.
Two minutes later Dundee were left stunned when Novo scored his second with a low drive through a crowded box.
In stoppage-time John Sutton's long-range shot flew well wide of the target but the Gers kept a clean sheet as they sealed three vital points.