Looking dangerous from the off, Fela Olomola notched his fifth of the season with an emphatic finish inside the opening five minutes.
Threatening on the counter, the lead was doubled midway through the half courtesy of a moment of magic from Otis Khan, as he equalled Olomola’s tally for the season.
Robbie Weir reduced the arrears just six minutes after the break, before Kristian Dennis equalised on 71 minutes.
Determined not to drop points for a third time on the road, captain James Bailey headed home a 90th-minute winner to send the 101 travelling fans into raptures.
Darren Way made two changes from the side that shared the spoils with Port Vale at the weekend.
Tom James recovered from a knock in time to replace the injured Dan Alfei at right-back, while Matt Worthington was handed a first start for Town in a straight swap for Connor Smith who missed the trip due to illness.
Looking determined to collect their first points on the road this season, the Glovers got off to a dream start with just three minutes on the clock.
With their first attack of the match, Francois Zoko held off his man expertly before feeding Olomola, whose instant shot from the edge of the box caught Joe Anyon off guard, flying in off the post.
Purring from their near-perfect start the lead was almost doubled inside the opening 10 minutes, as Otis Khan skipped past two tackles before curling an effort inches wide from 20 yards.
After a slow start for the Spireites, Louis Reed zipped a low drive just off target, before Town went close once again.
Khan’s dangerous delivery from a wide free-kick picked out Zoko, whose looping header crashed back off the crossbar.
Having come inches away from doubling their lead, Yeovil were almost pegged back against the run of play when former Glover Gozie Ugwu had to have his shot tipped round the post by an agile Artur Krysiak.
However, the visitors were soon back on the front foot and deservedly made it 2-0 with a superb solo effort.
Khan took possession wide on the left, skipped past both Robbie Weir and Laurence Maguire with lightning footwork before arrowing an effort into the back of the net from the white line of the box.
Looking good value for their lead, Way’s side continued to hold Chesterfield at arm’s length as Chris O’Grady and Ugwu threatened on occasion.
With the break approaching Andy Kellett had a goal-bound shot from close range heroically deflected wide, in what was the hosts’ best chance of the first period.
At the other end, Anyon needed two attempts to keep out Jake Gray’s venomous drive, as the Glovers rounded off an impressive opening 45 minutes.
Boasting a lead away from home for the third time in five outings, Town got off to a disastrous start to the second half.
Penned in their own half, Guy Branston’s side pulled a goal back on 51 minutes.
O’Grady’s teasing low cross picked out the run of Weir, who cleverly flicked past a hapless Krysiak to reduce the deficit to one.
Buoyed by their opener the hosts continued to press Town in search of an equaliser, with a Gray drive from the angle the only real rest bite at the other end.
However, the Derbyshire outfit struck an unstoppable equaliser to stun the Green and Whites courtesy of substitute Dennis.
Falling to Chesterfield’s top scorer 25 yards from goal, the striker wasted no time in looping a first-time shot over Krysiak from 25 yards.
Pegged back from a winning position for the third time away from Somerset it looked like being another frustrating evening for Way’s side.
However, after replacement Sam Surridge teased at late drama with a pair of late efforts, the striker turned provider as the game ticked into stoppage time.
Picking out Bailey at the back post, the skipper coolly headed past Anyon before racing off to celebrate in front of the travelling faithful.
With no time to respond the Glovers saw out victory to pick up their first win away from home since March.
Chesterfield: Anyon, Wiseman, Hird, Jules (Maguire 6’), Ugwu, Weir, Reed, Kellett (Flores 73’), Briggs, O’Grady (Dennis 67’), De Girolamo.
Bookings: Kellett 37’, Weir 58’
Subs not used: Lee, McCourt, Brewster, Dimaio.
Yeovil Town: Krysiak, James, Nelson, N. Smith, Gray (Browne 88’), Bailey, Worthington, Khan, Olomola (Green 67’), Zoko (Surridge 75’).
Bookings: N. Smith 12’
Subs not used: Maddison, Davies, Sowunmi, Santos.