The Lions belied their lowly league position to race into an 12-0 lead thanks to tries from Richie Hawkyard and Gavin Dodd, who kicked both conversions.
Ambler, who is on loan from Leeds, pulled a try back before half-time while Anthony Thackeray's try early in the second half brought the scores level.
Martin Ainscough's 50th-minute try edged Swinton back in front but Halifax substitute tied the scores for a second time before Ambler sealed victory just before the end and Lee Patterson kicked his fourth goal.
