Chesterfield arrived with hopes of survival still alive after three successive victories and those hopes burned even brighter when they went 2-1 up in the 71st minute.
Jordan Bowery was unmarked at the far post to put Spireites ahead after eight minutes from a right-wing cross, but Dominic Blizzard swept in an equaliser to make it all square at the break.
Danny Whitaker came off the bench and put the visitors in front with a fine strike from outside the box.
Three minutes later Yeovil sub Kieran Agard turned in the box and fired a left-footed drive past Tommy Lee.
With 10 minutes remaining minutes Yeovil snatched the winner . Lee had no chance as Andy Williams beat him from 25 yards for his 17th goal of the season.