Saidou Khan’s incredible goal from inside his own half gave Chesterfield the lead after 12 minutes.
But that was as good as it got as Tahvon Campbell equalised in the second-half and bagged another on 87 minutes.
Inih Effiong sealed the win with a third two minutes later.
This was Town’s first defeat of the season but they remain second in the table.
Here are Liam Norcliffe’s player ratings...
1. Scott Loach 7
Conceded three times and he will probably be disappointed he didn't prevent Tahvon Campbell's equaliser but he made three good saves before half-time and another decent stop after the break to keep Chesterfield in the lead. These were the first goals he has conceded away from home this season. Photo: Tina Jenner
2. Fraser Kerr 7
For me he was one of Chesterfield's better players on the night. There were a couple of strong bits of defending in the first-half. He did the basics well. Photo: Tina Jenner
3. Gavin Gunning 6
He made one great interception in the first-half on the edge of his own box and a won a couple of key headers from crosses and set-pieces. He kept driving his teammates on even at 3-1 down but the damage had been done. Photo: Tina Jenner
4. Jamie Grimes 5
He wasn't having his best night in general, particularly in the second-half, and then things got worse when he let the ball bounce and got shrugged off the ball by Campbell too easily for the equaliser. Photo: Tina Jenner