Wells made it 13 goals for the season 11 minutes from time to leave Wolves’ play-off hopes increasingly remote.
Wolves are now six matches without a win after a game which could have gone either way.
Jamie Paterson hit an upright in the first half for the hosts while Joe Mason had the ball in the net just before Wells’ winner, only for it to be disallowed for off-side.
Wolves boss Kenny Jackett is a long-time admirer of Bermudian international Wells. Town would not sell him in January when Wolves needed a replacement for Benik Afobe, sold to Bournemouth for £9m, and Jackett landed Mason instead.
Paterson came closest to breaking the deadlock in the first half when he cut inside and crashed a shot against the foot of the post.
Paterson dummied a defender on the right and almost caught out Carl Ikeme at his near post.
That chance came in the 24th minute and Wolves had an opportunity themselves five minutes later when Bjorn Sigurdarson showed touch and awareness to play in Tommy Rowe.
Rowe had a clear sight of goal but snatched at his shot and fired wide when he had time to spare.
Shortly after Town midfielder Philip Billing - who scored his first senior goal with a 30-yard stunner last week - almost got on the scoresheet at the wrong end, slicing his clearance.
In the second half Tommy Smith and Joe Lolley both had chances for Huddersfield but were off target.
Rowe ignored claims that the ball had gone out on the byline to cross for Matt Doherty to flick goalwards but Jed Steer saved.
James Husband had a great run, bursting clear of the Wolves defence and crossed with Wells free in the box.
Danny Batth failed to cut out the centre but Wells mis-controlled and the chance was wasted.
Sigurdarson thought he had breached the Town rearguard in the 72nd minute when he played Mason in behind but the effort was ruled out by the offside flag.
Karim Matmour fired agonisingly wide before a fine passing movement finally unlocked the door for Town.
Bunn, Matmour and Elvis Manu were involved in the build up before Husband whipped in a cross for Wells to make no mistake from 10 yards for the 79th minute winner.
Town boss David Wagner said: “Nahki Wells has a strong mentality and I believe in his ability to score goals.
“He knows he will always get chances in this team and stayed focused after missing one.”