Substitute Hector Sam was Wrexham's saviour with a last-gasp goal.
He was sent on for a late push after top scorer Juan Ugarte had failed to live up to his growing reputation for hitting the net.
Oldham played far better than when they lost by the same score on the same ground in the LDV Vans tie in midweek but they squandered chances throughout the game.
David Eyres thought he had scored after 17 minutes when he netted from Mark Bonner's cross but it was ruled out for offside.
Wrexham also had effort disallowed for offside when Ugarte headed in the rebound after keeper Les Pogliacomi saved from Andy Holt.
Chris Llewellyn was out of luck when he fired an angled shot across the Oldham goal where it beat the keeper but drifted inches past the far post.
And in the only other chance for the Dragons in the fist half, Ugarte's shot hit defender Will Haining near the line.
At the other Kevin Betsy nearly scored from a dipping 30-yard lob that a back-pedalling Ben Foster pulled down under his cross bar.
Foster had a busy afternoon and made another important save when he dived to collect Neil Kilkenny's right-wing cross as Chris Killen was about to pull the trigger.
Craig Morgan cleared another Betsy effort off the line and Foster tipped a Kilkenny drive wide with a reflex save.
It was all Oldham and they went close again when Haining headed over the net and Steve Roberts dived to block a shot form Betsy on the line.
Haining also missed from the rebound after Foster parried another drive from Killen but the luckless Latics couldn't find a way to turn their pressure into goals.