Stephen Hunt gave County the lead five minutes after the break only for Isaiah Rankin to level for the non-league side.
That silenced the home fans but they were back on their feet a minute later when Hughes struck the decisive blow with his tenth goal in eight games to set-up a home clash with Wigan.
County made their intentions clear early on with striker Karl Hawley lifting a shot over Rovers keeper Terry Burton but wide of goal in the fifth minute.
The former Carlisle hitman also fired wide from the edge of the box before Burton made a fine save to keep out Ben Davies' low fizzing shot.
Hawley and Hunt also went close as the Magpies piled forward in the first period but Rovers stood firm.
County defender Graeme Lee rattled the woodwork two minutes after the restart and their pressure finally paid off in the 50th minute.
Davies' cross caused chaos in the box and Hunt pounced to score from six yards.
Rovers midfielder Jonathan Smith then tested Kasper Schmeichel from distance and Rankin restored parity on 63 minutes.
The former Arsenal youngster made space for himself in the box and fired his shot beyond the reach of Schmeichel.
The lead lasted less than a minute though as veteran striker Hughes escaped his marker on the edge of the box and curled a stunning shot beyond the reach of Burton.
Davies, Hughes and Matthew Hamshaw should have added to the lead as County piled forward but Burton stood firm.
Rankin and Conal Platt had chances in the closing stages for Rovers but Schmeichel made two smart stops to secure the win.