Mark O’Hara, the thorn in the side of Rangers, grabbed a glorious double as gutsy Dundee grabbed a vital victory.
O’Hara has been a real hammer of the Gers, scoring an incredible four times in three games against them at Dens Park.
He gave the hosts the lead on 66 minutes, only for Josh Windass to level at the other end just four minutes later.
Remarkably, though, O’Hara wasn’t finished and restored the Dark Blues’ lead on 80 minutes with a composed finish after great lead-up work by sub Scott Allan.
He had previously scored in a 2-1 victory back on February 19 and the other came in a defeat back on August 13, 2016.
As for managerless Rangers, they were left to lick their wounds after successive defeats to Hamilton and now Dundee.
The Dens men kicked off without suspended skipper Darren O’Dea, with Josh Meekings taking his place at the heart of the backline. That was the only change to the starting line-up and the Light Blues, likewise, made just the solitary change, with Declan John in for Lee Hodson.
Manager Neil McCann had called for a wall of noise from the home fans but it was so cold any cheering was likely to be drowned out by the sound of chattering teeth.
The first opening of the game went to the visitors, with an unmarked Kenny Miller heading into keeper Elliot Parish’s arms at the back post after five minutes.
On nine minutes, it was Rangers on the attack again and this time Ryan Jack’s shot from outside the area was deflected wide for a corner.
John was then granted the freedom of Dens Park – well, most of it – as he raced upfield before Meekings finally stepped in to tackle him.
With 18 minutes on the clock, the Dark Blues nearly brought the match to life when Faissal El Bakhtaoui lashed in a shot from 30 yards that had to be pushed over the bar by Ibrox goalie Wes Foderingham.
Alfredo Morelos smashed a shot into the side-netting for Rangers, then a Paul McGowan strike was held by Foderingham as the action warmed up.
On 24 minutes, Parish did well to hold a 25-yard shot from Josh Windass as the Glasgow men broke quickly.
It was Rangers who were doing most of the pressing and there was yet another effort at goal on 29 minutes, with James Tavernier firing wide.
Parish then rode to the home team’s rescue twice within a minute.
Firstly, John found it all too easy to race into the home box, played a one-two with Morelos but Parish got in the way. Parish then came out to save at close-range from Daniel Candeias just as the Ibrox player looked set to make it 1-0.
It got even scarier for the Dens men on 39 minutes when a Tavernier cross from the right was sliced on to the underside of his own bar by Meekings.
Morelos was an inch away from getting his head to the ball at the back post but missed and crashed into the woodwork. He tried to play on but was eventually replaced by Eduardo Herrera. The hosts also made a substitution just a minute from the break when Sofien Moussa replaced an injured Marcus Haber.
There was drama on 50 minutes when Moussa pounced on a slack passback from John but the big man couldn’t make it count and eventually the ball broke to Roarie Deacon, whose shot was smothered by Foderingham.
That showed Dundee were right in this game despite all the opportunities for the opposition but they were on the back foot again on 56 minutes when Parish had to save a scissors kick from Miller.
McGowan escaped with a booking after a bad challenge on Ross McCrorie in front of the dugouts then, on 66 minutes, the home team took a dramatic lead.
A freekick from Jon Aurtenetxe was swung into the Rangers box and fell right in front of O’Hara, who slammed the ball into the net from 12 yards.
Sadly for them, though, the lead last just four minutes.
The Light Blues had Windass to thank for the equaliser as he rifled home a 20-yard shot that gave Parish no chance.
Miller almost gave the visitors the lead when he lashed the ball just past the post but instead the goal came at the other end with 80 minutes on the clock.
It was great play from Allan, who had come on for Deacon just two minutes earlier, in the build-up and the ball made its way through to O’Hara, who fired home to send the home fans wild.
Attendance: 8,548.
Dundee: Parish, Kerr, Kamara, O’Hara, Aurtenetxe, McGowan, El Bakhtaoui, Deacon (Allan 78), Hendry, Meekings, Haber (Moussa 44). Subs not used: Ferrie, K. Holt, Leitch-Smith, Etxabeguren, Curran.
Rangers: Foderingham, Tavernier, John, Wilson, Jack, Miller, Windass, Morelos (Herrera 45), Candeias (, J. Holt, McCrorie. Subs not used: Alnwick, Hodson, Bates, Hardie, Barjonas, Pena.
Referee: Kevin Clancy.