Huddersfield 6 Wigan 13
Morgan Escare made a splash as Wigan cemented second spot in the table - and a home semi-final.
The French livewire made the most of a rare start, scoring their first try and showing his class to help the Warriors to a seventh straight victory.
It certainly wasn't pretty - in miserable conditions, the contest was littered with errors and only gripped in the final few minutes.
But for Shaun Wane's outfit, this was all about claiming the two points which secured themselves a semi-final at the DW Stadium, against Castleford, in two weeks' time.
Having led 6-0 at the break, Escare struck a second-half drop-goal to nudge them further ahead.
But Huddersfield set up a nervy finish when Kruise Leeming's converted try cut the margin to a fragile one point with nine minutes to go.
Wigan kept their composure, Oliver Gildart racing onto George Williams' stabbed kick late on to secure the win.
There was one surprise to Wane's line-up, if not the 17 players picked; Escare started at full-back, with Sam Tomkins moving to halfback.
Thomas Leuluai (groin) was forced to wait for his milestone 250th match for the club - joining Sean O'Loughlin (calf), Ben Flower (prop), Liam Farrell (shoulder) as well as those out for the season (Joe Burgess, Liam Marshall, Willie Isa and Chris Hankinson).
Huddersfield, without a chance of cracking the top-four, were led out by Ryan Hinchcliffe on his final home appearance, while NRL-bound John Bateman had the honour of guiding out the Warriors.
Wane had called on his players to display more energy than their hosts, and from the start, they did.
They placed with pace and purpose, going close early on when Williams skidded a ball through which which was cleared before Tom Davies could reach it. They stayed on the front foot and, in the 10th minute, Sam Tomkins struck a penalty.
The pocket of Wigan fans who had braved the sluggish M62 made their presence heard in a cavernous ground.
And they were in full voice moments later when Escare feigned a pass, fended one defender and squeezed over for the opening try. Tomkins was off-target with the conversion but at 6-0 up approaching the quarter mark, they appeared to be well in control.
But the tempo quickly dropped and, in miserable conditions, the ball repeatedly squeezed out in tackles.
When Taulima Tautai spilled at the play-the-ball inside his own half, it needed Wigan's defence to scramble well to repel Huddersfield's efforts. Dom Manfredi, two-try returning hero six days earlier, defused one tricky attack and Davies another - though the latter blotted his copybook by spilling a high ball under no pressure.
Matty English had Huddersfield's best chance, charging from close range but halted by desperate defence - started by Tomkins, completed by Escare.
Early exchanges of the second-half gave no hint of an improvement in quality. Danny Brough pulled out one trick-play - a reverse kick which just beat the chasing Lee Gaskell - but Wigan were barely troubled.
Problem was, when they got the ball they were far too wasteful. When they finally managed to make their way into Huddersfield's territory, Escare slotted over a 30m drop-goal to put then into a two-score lead heading into the final quarter.
But the Giants responded well, Brough striking a 40-20 which put them onto the offensive; it needed an alert Tomkins to deny Gaskell after he cheekily kicked the ball on directly from dummy-half.
Wigan lost Romain Navarrete to a head test and, as the game became needly, Davies went close to securing the win with 12 minutes to go. But a try was ruled out and, instead of going 11, and possibly, 13 points up, they moments later had their lead cut to a slender one point when Brough converted a short-range try from Leeming.
The Giants finished with 12 men, Brough sinbinned for a high tackle on Escare before Gildart added the sealing try.
Tomkins converted, though that wasn't the end to the drama - he took offence to a late tackle by Jake Mamo, sparking a brief all-in melee on the whistle.