York would have moved level on points with St Helens with victory at the Totally Wicked Stadium.
And they looked as though they may have been on course to do so when Rhiannon Marshall’s penalty on the stroke of half-time and Savannah Andrade’s early second-half try put them 8-0 up.
However, Emily Rudge got Saints back in the game before two Phoebe Hook tries in the final 10 minutes put them in control.
Faye Gaskin sealed victory with a last-minute penalty after York’s Sinead Peach was sent off for dissent.
Wigan kept up the pressure on Saints as they ran in 17 tries without reply at Barrow.
Isabel Rowe scored a hat-trick for Warriors and kicked 12 goals, while Ruby Hunter, Mia-Jayne Atherton, Eva Hunter and Jenna Foubister all crossed twice.
Rachel Thompson, Lucie Sams, Georgia Wilson, Charlotte Meredith, Cerys Jones and Molly Jones were also on the scoresheet.
At Golbourne Parkside, tries from Lucy Johnson and Mollie Young gave Leigh a 10-0 lead, only for Huddersfield to hit back to lead through Fran Copley, Maddie Clegg and Amelia Brown.
Leigh levelled through Storm Cobain but Copley scored her second before Mackenzie Taylor earned the Leopards a point.