A second half double from substitute Danny Philliskirk saw Latics come back from 2-1 down to beat Scunthorpe United and extend their unbeaten run to seven games.
Andrew Boyce had given the Iron the lead in the first half before Jonathan Forte equalised minutes later.
Latics fell behind for a second time as Rory Fallon put the visitors ahead but Philliskirk's first and second goals of the season secured the comeback and the vital win.
It was a slow start to the game with both sides easing their way into proceedings.
Latics had the first opportunity of the game 13 minutes into the game. Bolton loanee Conor Wilkinson was causing a real threat in attack but the home side struggled to find a way through the stubborn Iron defence.
Scunthorpe grew into the game and Madden almost put them ahead on 20 minutes. Neat play between Gary McSheffrey and Fallon saw the latter cross for the former Yeovil man but goalkeeper Paul Rachubka punched the ball away.
Five minutes later, the goalkeeper pulled off a wonderful save from Fallon. The striker curled a shot from 25 yards which Rachubka plucked out of the air and tipped over the crossbar.
From the resulting corner, the Iron took the lead. Boyce rose highest from a McSheffrey corner and put the ball beyond the goalkeeper to give the visitors the lead.
It did not take Latics long to get back on level terms. The impressive Mike Jones threaded a through ball into the path of Forte and the forward notched his sixth goal of the season to equalise for the home side.
Latics had the momentum and went ever so close minutes later through Jones. The midfielder picked up the ball from 25 yards out and forced Bobby Olejnic to tip the ball over the bar.
For all Latics' momentum, they were caught out against the run of play and fell behind. Madden fed Fallon in the centre and the striker turned and slotted past Rachubka to give the Iron the lead for the second time.
Minutes before the break, defender George Elokobi was forced off with injury and he was replaced by Genserix Kusunga.
Philliskirk was introduced at half time and Latics started the second half positively, showing attacking intent.
Jones, who ran the midfield for the home side, stung the palms of Olejnic five minutes after the break as they went in search of an equaliser.
That equaliser did eventually come on 66 minutes as Philliskirk notched his first goal of the season. Brian Wilson raced to the byline and cut the ball back for the striker to equalise.
Latics were in the ascendancy and Wilkinson had a two great opportunities to put Latics ahead but Olejnic was equal to the striker's efforts.
As time started to tick away, the home side did manage to get the winning goal on 83 minutes. Liam Kelly's free kick was nodded back into the box by James Wilson and Philliskirk was at the back post to head home.
As the fourth official announced five minutes of additional time, substitute Amari Morgan-Smith went close but his tame effort was saved.
Scunthorpe threw everything forward in a bid to grab something out of the game but the home side held on and secured victory which keeps them unbeaten for the last seven games.
Oldham Athletic: Rachubka, B.Wilson, J.Wilson, Elokobi (Kusunga 45'), Mills, Jones, Kelly, Winchester (Morgan-Smith 79'), Forte, Poleon (Philliskirkv 46'), Wilkinson.
Subs not used: Brown, Dieng, Tidser, Dayton.
Scunthorpe United: Olejnic, O'Neil, Boyce, McAllister, McSheffrey (Adelakun 71'), Madden, Fallon (Sparrow 79'), Myrie-Williams, Brisley, Williams, Bishop (Kee 87').
Subs not used: Weaver, Dawson, Hawkridge, Howe.
Goals: Oldham Athletic (Forte 29', Philliskirk 66', 83') 3-2 Scunthorpe United (Boyce 26', Fallon 35')
Attendance: 3,837 (310 visiting supporters)