Josh Kelly gave the hosts an early lead and Dan Sparkes doubled the advantage with a free-kick on 20 minutes.
Town got back into the game just before half-time with a free-kick of their own from Jeff King and Kabongo Tshimanga equalised in the second-half.
The Blues were pushing for a third but it was the Magpies who went back in front from Kelly’s header from close-range.
The defeat leaves Chesterfield second in the table, one point off the top.
Here are Liam Norcliffe’s player ratings from the game...
Scott Loach 5
Conceded three times. He got a hand to the first goal and perhaps should have kept it out. Sparkes’ free-kick was well-hit but it went in the corner of the net that he was covering so he might be disappointed with that one as well. He did make one good save at 2-2 in the second-half when he came rushing out to make a smart block.
Tyrone Williams 5
Not as good as previous weeks. Made a rash and needless challenge on the edge of the box from behind and Sparkes scored the resulting free-kick.
Jamie Grimes 5
He was fine for the most part, winning plenty of headers, but he lost his man for the near post flick-on which led to the winner.
Luke Croll 6
The centre-back was quite influential in the second-half as he consistently stepped into midfield to build attacks. He was unlucky to see a goal-bound shot blocked when Town had momentum at 2-2.
Jeff King 5
He wasn't really at the races in the first-half as he struggled to create but he was often crowded out. He ended the half on a high with a brilliant free-kick into the top corner from the edge of the box which got Town back into it. Unfortunately he didn't really kick-on much after the break.
Curtis Weston 5
Didn't have his best game, particularly in the opening 45 minutes with some sloppy passes as the visitors lost the midfield battle.
Manny Oyeleke 6
Saw lots of the ball and tried to dictate play. Possibly needed to move the ball quicker at times. Tried to stop Kelly getting the shot off for the first goal but he was too late. Overall he was okay.
Alex Whittle 7
Town's best player on the night, in my opinion. Showed lots of energy and enthusiasm down the left and kept on plugging away. Out of everyone he looked most up for it.
Liam Mandeville 5
Really struggled to get into the game in the first-half although he did go close towards the end of the first 45 with a shot which went narrowly wide. Replaced in the second-half.
Jim Kellermann 5
Nothing came off for him and he was bullied at times. Had a one-on-one saved at 1-0. Came off at half-time with a twisted hip.
Kabongo Tshimanga 6
Scored his 22nd goal of the season when he prodded home to make it 2 2. Came close to another when he fired over from the edge of the box. Found himself surrounded at times but managed to keep hold of the ball more often than not.
Akwasi Asante 6
Replaced the injured Kellrman at half-time. One snap-shot from 18 yards out after turning his man brought a save. He worked hard but he didn't have much to work with in terms of chances after that.
Saidou Khan 5
Replaced Mandeville with less than 20 minutes to go. Failed to make an impact.
Stefan Payne N/A