Ollie Banks pounced to fire home the winner for the ten-man Spireites with just nine minutes to go.
Once the party atmosphere had died down at Oakwell and the game got under way, there were few clear-cut chances during a goalless first half.
Lloyd Isgrove was denied by Spireites’ ‘keeper Tommy Lee early on after he met a smart cross from Alfie Mawson.
Sheffield Wednesday boss and chairman unhappy after attackers leave for Premier League
Why Sheffield Wednesday left Dennis Adeniran out completely against Charlton Athletic
Darren Moore dismisses Barry Bannan over-reliance notion after surprise Sheffield Wednesday sub call
Chris Wilder says Sheffield United "ready to rock and roll" after Middlesbrough draw
Charlton Athletic boss gives Sheffield Wednesday ‘favourites’ tag – admits Hillsborough frustrations
However, the middle period of the first half belonged to the visitors.
They came close to breaking the deadlock when the recalled Gboly Ariyibi lashed a shot just wide.
Back came Barnsley, and leading scorer Sam Winnall was denied by a super Lee stop as he charged in to meet James Bree’s in-swinging cross.
The game burst into life just before the hour mark.
In the 57th minute the Spireites finally broke the deadlock as Lee Novak headed home a deflected cross, but credit to the Reds, they almost levelled within minutes.
Isgrove fired in a super strike, but the ball rebounded back out off the post.
The Reds grabbed their equaliser with 15 minutes to go.
And it was star man Adam Hammill again who did the business, firing into the top corner via a slight deflection.
The Spireites were reduced to 10 men shortly after when Jamal Campbell-Ryce was sent off after being shown a second yellow card, but then they went on to snatch victory when Banks tapped home Ariyibi’s cross.
Marc Roberts struck the post late on for the Reds.
Barnsley (4-4-2): Davies; Bree, Roberts, Mawson, White; Isgrove, Brownhill, Hourihane, Hammill; Fletcher, Winnall.Subs: Townsend, Scowen, Nyatanga, Chapman, G Williams, Toney, Watkins.
Chesterfield (4-3-3): Lee; Hird, Anderson, Raglan, Talbot; O’Shea, Liddell, Banks; Campbell-Ryce, Novak, Ariyibi. Subs: Herd, Ebanks-Blake, Dimaio, Donahue, Chapman, Orrell, Slew.
Referee: Neil Swarbrick (Preston).