Nathan Tyson tapped in the winner from Liam Mandeville’s cross with 10 minutes remaining at The Shay on Saturday.
Mandeville gave Town the lead in the first-half but the hosts equalised through Darren Stephenson.
Victory means the Spireites finish sixth and will play Notts County away in the play-off eliminator round next Saturday.
Here are Liam Norcliffe’s player ratings from the game and a dramatic day in West Yorkshire. ..
1. James Montgomery 7
Didn't have many saves to make but when called upon he made a superb stop early in the second-half from Byrne's header. How crucial that proved to be. Photo: Jim Fitton
2. Will Evans 8
Calm and composed. One stand-out moment was a vital interception in the first-half when Halifax were through on the counter. Photo: Jim Fitton
3. Gavin Gunning 8
Didn't miss a kick. A rock. His leadership at the end to drive his teammates on and get them over the line was excellent. Photo: Jim Fitton
4. Laurence Maguire 8
He was good in possession, defensively sound and almost scored with a header in the second-half which Johnson parried. Photo: Jim Fitton