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:

13. Billy Sharp 6
Thought he'd notched the winner when he tapped in from a yard out but the offside flag quickly stubbed out that joy. Photo: Howard Roe/AHPIX LTD

14. Ben Close 6
Similar to Crew, nothing too spectacular during his cameo. Photo: Howard Roe/AHPIX LTD

15. Jack Senior 8
Whistled a shot just over the crossbar as the game entered the latter stages - and then popped up with the clincher as he let rip from distance. Surely he's now a bona-fide goal machine with two in two? Photo: Howard Roe/AHPIX LTD

16. Damola Ajayi 7
Looked lively and showed intent as he looks to build on his renaissance over the last week. Photo: Howard Roe/AHPIX LTD

