Badgers at one stage held a 3-0 lead, but their visitors pulled level late in the game with extra-time looming.
But a semi-final place was secured with three late goals, in what was another classic Senior Cup game at the Jones and Co Stadium, after the 4-3 extra time win over Selston in the previous round.
Ben Muirhead opened the scoring on the quarter hour mark as he cut inside the box before firing home.
Two minutes had elapsed and it was Muirhead again who was on target, this time a header from Josh Batty’s cross.
What should have been a decisive third goal was scored, on 57 minutes, Muirhead crossing for Leigh Hutchinson to net.
But on 65 minutes, Hucknall pulled a goal back, James Duncan meeting a corner kick.
Two minutes later, Hucknall had another, Jamie Thomas netting from the far post.
With five minutes remaining Jack James brought the scores level.
Retford, to their credit, stemmed the tide and Muirhead won, then converted a spot-kick to make it 4-3.
The game was over on 90 minutes, Joe Knowles putting scoring from Hutchinson’s cross, before Hutchinson slotted home the sixth.
United now face a tough away trip to Garforth Town on Saturday before another away trip to Barton Town the following Wednesday.