The Spireites took a first half lead through Sylvan Ebanks-Blake but where undone by two goals after the interval as the Latics won 2-1 at a rain-soaked Proact.
In heavy rain both sides looked for an edge, and it was the Spireites who gained it when Dan Jones's cross evaded the 'keeper with Ebanks-Blake on hand to thump home from six yards.
With Oldham increasing the pressure with less than 20 minutes to go they levelled when a 20 yard shot was saved by Tommy Lee, Dominic Poleon sharp to turn home the rebound from an angle.
With time running out an unlikely winner came the way of the Latics as a 30-yard shot from Danny Philliskirk was pushed onto the post by Lee, whose luck was out as the ball rebounded back off the 'keeper and over the line.
The match started with a minute's silence as a mark of respect for the Paris terrorist attacks on Friday night which claimed the lives of at least 140 people.
After a quiet opening few minutes Chesterfield carved out the first chance as they looked to get off to the best possible start. A Richard Wood ball forward was flicked on for Ebanks-Blake, but he sent a shot wide as he struggled to control the ball on the slick playing surface.
However, Oldham began to grow into the game soon after. First, Carl Winchester volleyed wide from the edge of the box, before the lively Mark Yeates won a corner by dancing round Drew Talbot.
It was backs to the wall for the Spireites in the early exchanges despite Oldham not forging any clear chances. Yet Chesterfield were the next to go close through Jay O'Shea. He was played in on the left by Jones, but his cross-shot floated just over the bar.
At the other end Ian Evatt tripped his man right on the corner of the area giving Yeates the chance to hit one of his trademark free-kicks, but Lee wasn't tested as he caught the shot well.
The chances were coming at both ends as this time Sam Morsy played in Jones down the left following a clever Gardner dummy. Jones's low cross found Ebanks-Blake, but Lee Novak was in an offside position; just as a minute's applause took place for former Spireites loanee Marton Fulop who tragically passed away this week.
Oldham never looked confident at the back, and almost put through their own goal when keeper Joel Coleman failed to punch clear a cross and the ball slipped agonisingly behind off his glove for a corner.
The game needed a spark as it was petering out towards half time, and it got one with ten minutes to go. Gardner held the ball up on the left as Jones made the overlapping run, he played a low ball across the six-yard area which the keeper didn't claim, and Ebanks-Blake was there to slam the rebound into the net for his fifth goal in five league games.
The visitors came straight back at Chesterfield, though. Yeates found James Wilson whose rasping drive was deflected inches wide of the goal as Lee was left helpess. However, it could have been 2-0 soon after as it was Gardner's turn to go close. Ebanks-Blake didn't give up on a long ball and found winger, who after turning his man saw his shot deflected wide for another corner.
The goal saw Chesterfield become more composed on the ball, but The Latics were still cutting through the Spireites' back line. Ebanks-Blake fouled Winchester on the edge of the box, but Joseph Mills the resulting freekick well wide in the final chance before the break.
The visitors started the better of the two sides in the second half, when Yeates saw a volley bravely blocked by Evatt when the ball looked like it was heading in, before the resulting corner was eventually claimed by Lee.
The away side clearly thought Chesterfield's weak link was down their left as they continued to get at Talbot. Poleon and Yeates both saw crossed headed away at the last as Oldham probed for an equaliser.
It was an end-to-end opening to the second period as Jones and Gardner both saw attempts to find Novak in the box ousted by Wilson while they were mindful of an Oldham counter.
Jones then whipped a free-kick into the box which Novak flicked on, but Ebanks-Blake couldn't get the neccessary touch which would have doubled the home side's lead.
The chances soon dried up, though, as Oldham began to get a real grip of the contest. Chesterfield were camped on the edge of their own penatly area, but the away side couldn't create a serious opportunity.
Chesterfield looked comfortable dealing with Oldham's minimal threat going forward, but Lee was forced into a save as Danny Philliskirk broke through the midfield and found Winchester, but his low effort was easily stopped.
However, Oldham equalised with just over quarter of an hour to play. Substitute Giorgio Rasulo wriggled away from Wood's challenge on the edge of the box before firing low at Lee, who could only parry the ball to Poleon who smashed home from the tightest of angles.
The goal gave the Spireites a new lease of life as they now had to search for a second goal. Jones saw another free-kcik cleared, before O'Shea played a neat reverse ball into the srea which Novak failed to meet.
Chesterfield were now playing like the home side again as they were no longer depending on counter attacks, but in an Oldham break Poleon flashed a shot narrowly wide of Lee's right-hand post as he looked to bag his second of the game.
But the home side nearly re-took the lead at the opposite end, as Jones's mis-hit cross bounced off the top of the crossbar with the keeper almost left red-faced.
However, it was Oldham who scored the winner late on to seal all three points with three minutes of normal time to remaining.
Philliskirk broke away through the middle of the park, and he hit a low right-footed stirke which skidded off the turf, struck the post and went in off the back of Lee to send the visiting fans into ecstasy.
With the Spireites committed forward in search of a late leveller Poleon almost made it 3-1 as he broke away on the right, but was forced wide by Evatt and saw his powerful shot saved by Lee.
The home side failed to muster any late chances as they succumbed to another home defeat, with Oldham claiming their first win over Chesterfield in seven attempts.
Chesterfield: Lee (gk) - Jones, Evatt, Wood (Raglan 89'), Talbot - Morsy (c), Herd (Ariyibi 89'), O'Shea, Gardner (Simons 79') - Novak, Ebanks-Blake
Subs not used: Banks, O'Neil, Dieseruvwe, Hird
Oldham Athletic: Coleman (gk), Mills, Dieng, Wilson, Kelly (c), Poleon, Philliskirk, Winchester (Fulton 69'), Wilson, Yeates, Higdon (Rasulo 69')
Subs not used: Brown, Vassell, Eckersley Fuller, Renshaw
Chesterfield: Ebanks-Blake 34'
Oldham Athletic: Poleon 72', Lee (87' (og)