Former Halifax half-back Ben Black condemned his old club to their second defeat of the season in the Co-operative Championship with the all-important try in Batley's 23-16 win at Mount Pleasant.
Halifax took an early lead through captain Sean Penkywicz and led 16-14 thanks to second-half tries from Lee Patterson and former Batley forward Dane Manning. but they were reduced to 12 men with the dismissal of ex-Batley winger Wayne Reittie.
The Bulldogs had led 12-6 at half-time thanks to tries from Alex Bretherton and Alex Walmsley, and Gareth Moore kept them in touch with two penalties early in the second half.
Moore then edged his side back in front with a drop goal before Black went over for the match-winning try two minutes from the end.
The win lifts Batley up to second, with Halifax collecting a bonus point to stay top.Leigh are up to fifth thanks to a 30-10 win over lowly Hunslet at Leigh Sports Village.
The Hawks took an early lead through Elliott Hodgson's try but the Centurions responded through Tommy Gallagher, Rob Parker, James Laithwaite, Ryan Brierley and Anthony Nicholson, with Martyn Ridyard kicking all five conversions, to lead 30-6 after 55 minutes.
Hunslet got their defence together to prevent any more scores and scored a consolation try through Lee Brickwood 10 minutes from the end.