George Carmont scored a last-minute try as Wigan snatched victory in an entertaining pre-season friendly at the Galpharm Stadium.
The Warriors were on the back foot for most of the game and trailed 24-16 with four minutes left before staging a late rally to take the lead for the first time.
Both teams were virtually at full strength for their last major hit-out before the start of engage Super League XIV and there was enough to encourage both coaches.
Wigan's new hooker Mark Riddell scored a brace of tries and Kevin Brown showed he can be the answer to Huddersfield's problem stand-off spot.
Having failed to land Australians Todd Carney and Nathan Fien as a replacement for the departed Chris Thorman, new Giants coach Nathan Brown will have been delighted with the display of his namesake.
The utility back combined effectively with another Wigan old boy, Luke Robinson, and produced sublime passes to create two of Huddersfield's five tries.
The game appeared to turn on the sin-binning of former Great Britain prop Stuart Fielden after 24 minutes for a late tackle on Robinson, with the Giants scoring three tries while Wigan were down to 12 men.
When three-quarters David Hodgson, Michael Lawrence and Paul Whatuira all went over for tries, to add to Simon Finnigan's early score, the home side looked set for a handsome win.
But Brett Hodgson was successful with only one of his four conversion attempts and his error at the start of the second half let Wigan back in the game.
Ireland's goal-kicking winger Pat Richards intercepted a sloppy pass from the former Wests Tigers full-back to score a try, and when Thomas Leuluai - making his first appearance since the World Cup final - jinked over, the Warriors were only two points behind.
But substitute Danny Kirmond looked to have clinched victory for the Yorkshiremen when he took Lawrence's clever offload and tore away for a 30-metre try and Hodgson kicked a second goal.
However, Riddell grabbed his second try after 77 minutes and Carmont pounced for the winner two minutes later, with Richards taking his goal tally to four.