There was drama before the game as Michael Dobson pulled out injured in the warm up half an hour before the game started.
Paul Gibbs took his place in the starting line up and Kevin O'Connor
was promoted to the subs bench after he was originally left out in favour of David Theobald.
Oldham started brightly in the first five minutes and two efforts by Smart went close.
In the seventeenth minute, The Latics were awarded a penalty for a foul on David Aryes. Carlo Corazzin stepped up but Smith made a good Save, diving low to his right and pushed the ball away for a corner.
Stephen Hunt was booked for protesting the decision by Paul Rejer.
The Bees took the lead after 29 minutes, Ben Burgess firing home from the edge of the area.
Oldham equalised a minute into injury time, David Aryes scoring after another penalty was awarded for a push by Ivar Ingimarsson on McNiven.
The second half was scrappy and The Bees had a goal disallowed. Lloyd Owusu was adjudged to have fouled a Latics defender before bundling home.
Oldham took the lead on 61 minutes through Allan Smart. Ivar Ingimarsson and Ijah Anderson collided and Smart took advantage to fire home.
Seven minutes later the task looked ever more like a mountain to climb, Smart beating Smith to score his third in two games.
Three minutes before time Ben Burgess pulled a goal back with a neat finish from a crossfield pass from Martin Rowlands which two Oldham players failed to clear.