Siem De Jong had given the Magpies the lead on 14 minutes with a powerful effort but the goals from the second half substitutes secured the home side the victory.
On a sunny night at SportsDirect.com Park, the game started at a slow pace as both sides eased into the game.
Latics had chances going forward with Mike Jones and James Dayton bearing down on the defence but both could not thread a through ball to an onrushing striker.
Newcastle United took the lead on 14 minutes through a wonder strike from new signing De Jong.
The attacker struck his initial free kick against the wall but thundered the rebound beyond Paul Rachubka into the top corner to give the Magpies the lead.
The visitors started to dictate the pace of the game but Latics' defence held firm to stop the Magpies from attacking.
Trialist Jonathan Forte started to make an impact on the game as his pace and crossing got supporters off their seats but unfortunately they would not fall to a Latics player.
The second half started with Oldham Athletic making a single change. Summer signing Jones played an excellent ball over the top to Forte but the goalkeeper expertly saved with his feet to preserve Newcastle's lead.
Both sides made a host of substitutions on the hour mark and two combined to bring Latics level.
David Mellor's corner found the head of new signing Dieng to power home past Jak Alnwick to find a leveller for the home side.
The goal gave Oldham Athletic confidence and on 78 minutes, Latics took the lead.
Trialist William Gros received the ball just into the Newcastle half and used his pace and strength to muscle past the Magpies defence and fire low past Alnwick to give the home side an unexpected advantage.
Latics did not sit on their one goal lead and went in search of more. Neat work in the midfield saw Jordan Bove feed Connor Brown on the left-hand side but the defender's shot narrowly went over the crossbar.
With time running out, Newcastle almost found an equaliser but Rachubka was out quickly to deny the Magpies striker.
Attendance: 2919 (852 Visiting Supporters)