Huddersfield scored 25 unanswered points to end the three-match winning run of Wigan, who missed the chance to go second in Super League.
The home side trailed 12-0 to tries from Sean O'Loughlin and Matty Bowen, but led at half-time as Aaron Murphy, Shaun Lunt and Joe Wardle all crossed.
Wardle added his second and a Danny Brough drop-goal made it 25-12.
Dom Manfredi replied for Wigan but Jermaine McGillvary made it safe for the hosts, who go fifth in the table.
Winger McGillvary scored a hat-trick when Huddersfield defeated the Warriors in the opening Super League game of the season in February, and his clinching try helped the Giants complete the double over the reigning champions, with Joe Burgess's last-minute score for the visitors merely a consolation.
Injury-hit Wigan had won their previous three matches without a host of first-team regulars but were unable to extend that sequence, despite the returns of experienced duo O'Loughlin and Bowen, who both crossed for tries inside the first 18 minutes.
Captain O'Loughlin, who had been out of action for a month, swapped passes with Manfredi before touching down unchallenged for the game's first points.
Bowen showed neat footwork to beat two Giants defenders and held off two more tackles to score a second, but Wigan's lead was short-lived as Huddersfield fought back with three tries of their own in the space of 11 minutes.
Brough's floated pass sent Murphy over in the corner, before hooker Lunt dived over from close range to level.
And after Manfredi and Burgess denied Huddersfield skipper Brough a yard from the line, Wardle touched down to put the hosts ahead for the first time.
Huddersfield, winners of the League Leaders' Shield in 2013, took a six-point lead into half-time and escaped a minute into the second period when an effort from teenager Burgess was ruled out for a knock-on.
Wardle then crossed again, although much of the credit for his second try of the evening must go to second-rower Brett Ferres, whose superb offload gave the centre a free run to the line from 40 metres.
Brough, voted Super League's Man of Steel last season, successfully converted the first four tries and landed a one-pointer to increase the gap to 13 points, but Manfredi claimed Matty Smith's high kick to keep a determined Warriors outfit in touch.
However, McGillvary pounced on a poor kick by Burgess to earn Paul Anderson's side an impressive victory, despite Wigan's late reply.
Huddersfield coach Paul Anderson:
"It was a win based on effort and attention.
"We didn't throw a great deal of rugby at them. We just had to keep telling them to keep playing because we didn't want them to go into their shell.
"It showed we are getting back into some sort of groove, although 20 points conceded is still not good enough.
"I thought we gifted them some points with some poor decisions defensively, but we showed character to come back."
Wigan coach Shaun Wane told BBC Radio Manchester:
"I'm disappointed with the result, but the best team won on the day.
"They made a few changes and we didn't handle it well. The ruck was unbelievably slow and that benefitted them immensely. On the back of that, they've got some talented players in their team.
"They're well coached, they're better than what they showed last week [against St Helens] and we found that out tonight."
Huddersfield Giants: Grix; McGillvary, Cudjoe, Wardle, Murphy; Brough, Wood; Faiumu, Robinson, Johnson, Ferres, Lawrence, Bailey.
Replacements: Crabtree, Lunt, Ta'ai, Patrick.
Wigan Warriors: Bowen; Manfredi, Goulding, Gelling, Burgess; S. Powell, Smith; Dudson, Williams, Crosby, Bateman, Hughes, O'Loughlin.
Replacements: Taylor, Burke, Hampshire, James.
Referee: Ben Thaler