Pat Hoban headed two goals in the final 10 minutes of the game as Mansfield Town advanced to the quarter final stage.
Manager Stephen Robinson made three changes to his side as he handed George Edmundson his first start since the end of August.
And it would be Latics who had the first opportunity of the game in the opening minute of the game.
Lee Croft found Ryan McLaughlin in the middle whose deft touch laid it into the path of Paul Green to strike but his shot was blocked.
The returning Edmundson would go into the referee’s notebook on 15 minutes for a barging tackle on CJ Hamilton as Mansfield shaded possession in the opening stages of the game.
However it would be Athletic who had the better chances throughout the half with the first coming midway through the half.
McLaughlin beat the offside trap and latched onto a Green through ball, he raced through on goal but former Latics loanee Jake Kean stood up tall to save well.
Latics continued to put on the pressure as Brian Wilson struck over whilst on the half hour mark Croft had a shot blocked in front of goal.
Athletic were getting joy down the left hand side with the experience of Croft and Wilson really causing problems for the Mansfield Town defence.
And Latics were left scratching their heads as to how they were not ahead at the break.
A cross into the box was headed back into the path of Darius Osei to volley from six yards but somehow Krystian Pearce managed to block his fierce effort on the line to prevent Latics going ahead.
One minute later, Wilson tried his luck from 25 yards which was goal bound but an unorthodox save from Kean further prevented Latics taking the lead before the break.
The second half started off slowly with both sides picking up a booking as Chris Clements and Wilson both entered the referee’s notebook.
Robinson made a double change on the hour mark as the injured Croft and Ryan Flynn were replaced by Ollie Banks and Billy Mckay.
Whilst Pay Hoban had a chance for Mansfield Town on 62 minutes, Ousmane Fane made a surging run through the midfield which caused a lot of danger for the Stags defence but he was stopped in his tracks on the edge of the box.
Carl Winchester entered the field of play on 70 minutes as two minutes later Clements curled an effort into the hands of goalkeeper Connor Ripley.
Latics started to put on the pressure as Mckay’s flicked shot goalwards was deflected for a corner whilst from the following set piece Edmundson nodded over from 12 yards.
Minutes later, and following another set piece, Banks’ delivery found Clarke in the centre but his header went wide of the post.
The visitors took the lead on 84 minutes as Hoban converted from close range after Ripley went out to stop a cross into the box from Baxendale.
Latics felt they should have been awarded a penalty in the 90th minute as McLaughlin beat his man and seemed to be bundled over but the referee waved away the protests.
Two minutes later and Hoban won the tie for Mansfield Town as he beat his defender in the air to head home from 12 yards and seal their passage into the next round.
Mansfield Town: Kean, Bennett, Howkins (McGuire 70’), Peace, Benning, Collins, Baxendale, Clements (Thomas 83’), Hamilton, Hoban, Arquin (Green 83’).
Subs not used: Shearer, Rose, Hurst, Hemmings.
Oldham Athletic: Ripley, Wilson, Clarke, Edmundson, Law, Croft (Mckay 61’), Fane, Green (Winchester 70’), Flynn (Banks 61’), McLaughlin, Osei.
Subs not used: Kettings, Dummigan, King, Glackin.
Goals: Mansfield Town (Hoban 84’, 90+2’) 2-0 Oldham Athletic
Attendance: 1,343 (149 visiting supporters)