Wigan Warriors held off a spirited Huddersfield Giants to secure a 26-19 win and move top of Super League.
Ryan Brierley's hat-trick had put Huddersfield 18-12 up in a second half, much of which they played with 12 men after Nathan Mason and then Aaron Murphy were sin-binned.
But the tide turned Wigan's way on the back of a questionable call at a late scrum as the Warriors were awarded the put-in with Huddersfield adjudged to have charged an attempted kick down on its way over the touchline.
Matty Smith and Danny Brough traded late drop goals, but Dan Sarginson's late try secured the win for Wigan.
Anthony Gelling had put Wigan into an early lead, but Huddersfield fought back with some scintillating play that belied their status as Super League's bottom side.
First Leroy Cudjoe side-stepped and shoved his way into space before setting Brierley on his way to his first Super League try since joining the Giants after a score-laden Championship spell with Leigh Centurions.
Brierley was again in the right place to finish soon after, latching onto a smart reverse kick from Brough to dot down.
Huddersfield's indiscipline began to bite them after the break and John Bateman snuck over in the set immediately following Mason's yellow card for a high hit before Brierley completed his treble against the run of play, only for Smith to dummy a ponderous defensive line to get through and equalise again.
Smith's two drop goals outdid Brough to put Wigan in the ascendancy before fast hands and a quick Josh Charnley break sent Sarginson away to celebrate past the try line before touching down and rounding off a hard-earned win.