Ferres was the show-stopper as Huddersfield remained at the summit of Super League with the only remaining 100 per cent record.
he second-rower pounced on a loose inside pass from Pat Richards to charge 90 metres for the try in the dying seconds to scupper Wigan's hopes of rescuing the game in a frantic finale.
Danny Brough kicked his fifth goal of the afternoon and the Giants had passed a crucial test of their character to the delight of their fans.
Their defence came under relentless pressure in the final quarter but they showed great resolve to deservedly claim a third successive win.
The Warriors were without star man Sam Tomkins, who failed to recover from a shoulder injury picked up in a collision with Adrian Morley in last weekend's draw with Warrington. And Wigan certainly missed his attacking flair when they were knocking at the door for so long in the second half.
But you couldn't take anything away from a Huddersfield side that has developed a cohesion and will to win under new coach Paul Anderson that will make them stronger title contenders this season.
"This will give us a helluva lot of belief going forward," said Anderson.
"It wasn't pretty but we needed a game like this. Instead of blowing teams away we needed to get into an arm wrestle.
"Defensively we were fantastic and showed great composure under the huge amount of pressure Wigan put on us.
"We only had one play-the-ball in the last 11 sets. It was a good physical game played tough by two very good teams."
Wigan coach Shaun Wane had no complaints after seeing his side suffer their first defeat of the season.
"Overall the best team won," he said. "We played well in patches but there were missed opportunities and too many penalties. We weren't crisp enough with our final plays.
"Any team will miss a player of Sam Tomkins' abilty but I have no excuses.
"Defensively Huddersfield were outstanding. They are a well-coached team."
Wigan raced into a 10-0 lead in the first 11 minutes. Liam Farrell took Blake Green's pass to go through Luke Robinson's tackle to score. And it was Farrell's break that gave the supporting Josh Charnley a score.
The Warriors were making easy yards at this stage but the introduction of Eorl Crabtree and Shaun Lunt off the bench revived their fortunes.
A strong run from Ferres gave the Giants the field position for Jermaine McGillvary to go in the the corner, with Brough adding the extras.
The Giants went ahead after 49 minutes when Jamie Cording went behind the posts from Lunt's short pass, leaving Brough an easy conversion.
Brough landed two penalties in the face of some hostile Wigan attacking play before Ferres staged his grandstand finish with his third try in as many games.