Richard Marshall’s side, who ended a six-game losing streak at Whitehaven last weekend, came back from 18-8 down in the second half, with late scores from captain Scott Murrell and Cook Islander Adam Tangata finally sealing their success.
Oldham took the lead when Halifax winger Will Sharp lost the ball in a heavy tackle and centre Kieran Gill scooped it up to score under the posts.
Lewis Palfrey kicked the conversion, but the home side were level inside the next minute.
Half back Gareth Moore hoisted the ball high and Ben Johnston’s pass sent winger Ben Heaton over in the right-hand corner, although Nick Rawsthorne’s missed conversion left the visitors leading 6-4.
That deficit didn’t last long, Rawsthorne himself scoring after some sharp passing from Johnston and hooker Ben Kaye.
The conversion was inches wide again and the scoreline stayed at 8-6 until the break, with Oldham rarely threatening and Halifax undoing most of their good work with the kind of basic errors that have blighted their season.
The home side made the worst possible start to the second period, conceding two tries in the opening minutes of the half to Gill, a long-range interception, and a point-blank effort from Kenny Hughes, both converted by Palfrey for a 18-8 lead.
Again, Halifax rallied, Rawsthorne putting Heaton in for his second and Miles Greenwood scoring from Johnston’s stabbing kick, Gareth Moore’s conversion levelling the scores at 18-18. Halifax edged 20-18 ahead with a Moore penalty after Greenwood had gone close to scoring and then clinched things with late scores from Murrell and Adam Tangata, both converted by Moore.