In a back-and-forth first half, the Gers found themselves behind at the interval despite goals from Kemar Roofe, who was given the nod from the off as he stepped up his return from injury, and Paul Nsio.
However, they emerged for the second half with a renewed intent, with a brace from James Graham, coupled with Archie Stevens’ strike, turning the contest on its head.
Indeed, the Gers were boosted pre-match by the inclusion of Roofe in attack as the Jamaican looks to build up his minutes following his recent return to action.
And the 31-year-old forward wasted precious little time in making an impact as he fired Gers B ahead inside four minutes when he rose highest from Robbie Fraser’s cross to guide a cushioned header into the bottom corner.
Dundee then pegged the home side back when Rangers switched off from a near post corner that allowed the visitors to level proceedings nine minutes later.
Zak Lovelace soon tested his luck when he raced down the left-hand side and dragged an effort agonisingly wide of the far post on his unfavoured side.
However, it was to matter little as the 18-year-old turned provider for Paul Nsio to restore Rangers’ advantage, lifting a delightful pass into the midfielder who controlled impeccably on his chest and poked a smart finish under the Dundee goalkeeper.
Opportunities went begging for the home side thereafter, who were made to pay six minutes before the interval when a defensive error saw an errant backpass trickle over Mason Munn’s goalline.
The first half appeared to be petering towards a conclusion before the away side edged in front for the first time on the afternoon when a wicked free-kick from the right wreaked havoc in the Gers penalty area and beat Mason Munn all ends up via a deflection.
The half-time interval brought a pre-planned substitution when Roofe was replaced by Chris Eadie, 15 years his junior, following a positive first-half from the forward.
The referee soon pointed to the penalty spot five minutes into the second half when Connor Allan went down inside the penalty area but, as hitherto seemed to sum up the afternoon for the Gers, Lovelace sent the resulting spot-kick wide of the goal.
However, Rangers were soon back on level terms two minutes later when Archie Stevens reacted first to a dangerous delivery across the face of goal to stab the ball over the goalline.
The hosts had certainly upped the intensity since the start of the second period and they were ahead on 66 minutes when Lovelace showed tremendous pace down the left to pick out Graham who steered a composed first-time finish under the body of the Dundee goalkeeper.
The young Gers’ tail was firmly up as they went in search of a fifth goal of the afternoon, with substitute Thompson Ishaka steering an effort wide with the goal at his mercy from 18 yards out.
The all-important fifth goal of the contest then arrived for the Gers two minutes from time when Graham unleashed a powerful strike from the edge of the penalty area that deceived the Dundee goalkeeper via a deflection to seal a victory for the hosts.
RANGERS B: Munn, Allan, Grant (Hutton, 70), Yfeko, Fraser, Strachan, Nsio (McClure, 70), Graham, Stevens (Curtis, 72), Lovelace (Ishaka, 70), Roofe (Eadie, 45; Gentles, 72)
Subs not used: Halliwell