Grant McCann's side had to come from behind but were helped when the hosts had a man sent off in the second half, eventually managing to turn the screw and seal a place in Monday’s draw.
Jordan Gibson fashioned the first chance of the game when he latched onto a brilliant forward ball through the middle by Luke Molyneux. Gibson advanced towards goal but saw a shot smothered by the onrushing Zach Hemming in the home goal.
The hosts had to wait until the half-hour mark for their first proper venture forward when Lee Bonis saw a shot deflected just past the post and out for a corner.
Thimothee Lo-Tutala then made an excellent save to keep out a Liam Mandeville shot but it fell right into the path of Bonis who gleefully tapped in for his second goal against Rovers in as many games.
The visitors weren't behind for long, mind. Skipper Owen Bailey was on hand to plant home a header from a glorious Molyneux cross from the right.
The Spireites started the second half brighter and Mandeville prodded a shot just wide a few yards out before Rovers went forward and saw Molyneux go close after a quick breakaway.
The game's turning point then came on the hour when John Fleck was shown a straight red card for a lunging tackle on Bailey - he'd only been brought on as a sub five minutes earlier.
Rovers then sought to make the man advantage count as Molyneux fired a warning shot that was straight at Hemming before the over-worked stopper tipped a long-range Jamie Sterry striker over the bar.
Sub Billy Sharp thought he'd scored from just a few yards out only for the assistant referee's flag to quickly rule it out for offside. But another sub eventually popped up with the winner when Jack Senior fired home from distance to finally break Chesterfield's stubborn resistance.
Here's how we rated the Rovers players in Derbyshire:

9. Jordan Gibson 7
Early chance after a wicked upfield pick-out from Molyneux, but Chesterfield's goalkeeper was out quick to smother a close-range effort. Nice jinks and contributions throughout before going off late on. Photo: Howard Roe/AHPIX LTD

10. Brandon Hanlan 6
Struggled to really get into the game. Engaged in a proper scrap up against wily old centre-halves McFadzean and Dunkley and in truth didn't get much change out of them. Photo: Howard Roe/AHPIX LTD

11. Luke Molyneux 9
Certainly had his Weetabix. Some bright moments where his skill outdid markers and his touch was a joy to behold. Glorious centre for Bailey's header. Was easily Rovers' go-to man. Photo: Howard Roe/AHPIX LTD

12. Charlie Crew 6
Zipped it about and mostly kept it simple with his passes. Photo: Howard Roe/AHPIX LTD

