However, the striker headed his effort just wide despite getting a good connection on the ball.
Connor Goldson then came close with his volleyed effort but it was again just wide of the target.
It looked as though the Light Blues pressure was going to pay off when they were awarded a spot kick.
Jordan McGhee penalised for a tug on Alfredo Morelos in what looked to be a very soft penalty call.
However, the hosts got quick justice when James Tavernier skied his spot kick over the bar.
There were four minutes of added time due to the earlier disruptions but Rangers were unable to find an equaliser as they went in trailing.
In the second half, Giovanni van Bronckhorst rang the changes in an effort to get his side back into the match.
Joe Aribo and Fashion Sakala coming on to replace Scott Arfield and Filip Helander
The subs did not get a chance for an immediate impact as for the third time the match was delayed from the restart.
Tennis balls were thrown on the pitch by Rangers fans throughout the game at Dens ParkCredit: Willie Vass
Rangers fans throwing more toilet roll and tennis balls onto Dens Park to continue their protest.
The pitch was once again cleared as the second half resumed in Tayside.
Dundee were there forced into an early change in the second period with Paul McGowan limping off to be replaced by Max Anderson.
The away side started in a similar fashion to the first half as they pushed for an equaliser.
The Light Blues forced three excellent saves from Dundee keeper Ian Lawlor who kept out efforts from Morelos and Aaron Ramsey.
BETTING SPECIAL – BEST NEW CUSTOMER OFFERS AND FREE BETS
However, the Irishman did not cover himself in glory moments later as the Gers got their equaliser.
James Tavernier whipping in a cross from the left that was headed across goal from sub Kemar Roofe.
Lawlor got a touch on the ball but not enough to push it away from the goal.
It instead went all the way through to Ramsey at the near post who bundled the ball over the line for his first Rangers goal.
After the equaliser Dundee boss Mark McGhee switched up his side in order to ease the relentless Rangers pressure.
Zak Rudden being replaced by Nial McGinn in an effort to add more pace to his front line.
There was then ANOTHER delay as the sprinklers came on midway through the match.
The match got back under way and looked as if the points would be shared as the minutes trickled down.
Sprinklers briefly stopped play at Dens ParkCredit: PA
However, the champions showed their power of recovery to net a dramatic late winner.
Tavernier’s cross finding Roofe in the box, with the striker’s effort looping up in the air.
Goldson kept his composure to turn the ball in and spark pandemonium in the away end.
Despite netting late on it was not the final kick off the match, far from it as there was seven minutes of added time.
But the Gers managed to negotiate the closing period to secure a big win and keep them within three points of table topping Celtic.
Christie Elliot headed Dundee into the leadCredit: PATavernier missed Rangers first half penaltyCredit: Willie VassAaron Ramsey bundled in his first goal for Rangers equaliserCredit: Willie VassGoldson fired in a late winner for RangersCredit: Willie Vass
Keep up to date with ALL the latest news and transfers at the Scottish Sun football page