The former Bradford forward struck a sweet first-half volley and kept his cool to net a penalty after controversy involving referee Carl Boyeson.
Edward Upson had equalised for the visitors but there was to be no denying Wells and his team for a first home win in 11 matches.
The opening half hour was dreadful but Upson woke both sides up by rattling the bar on 29 minutes.
Upson’s corner from the left came back to him off a Town defender and he cut inside before curling a shot from 20 yards which hit the woodwork.
The midfielder made a mess five minutes later when he gifted the ball to Terriers wing-back Jack Robinson.
He sprinted forward but then dallied on the ball on the edge of the box instead of shooting and was tackled.
Soon after Wells put Huddersfield ahead with a goal similar to the volley he scored on his Town debut against Millwall in January.
A long punt by Joel Lynch was flicked on by Bunn and the striker hit a sweet strike past keeper David Forde into the right corner on 37 minutes.
The lead did not last long as the unmarked Upson fired in the leveller from a Scott McDonald pass on 41 minutes.
Town took the lead after the break from the spot.
Nicky Bailey felled Harry Bunn in the box on 56 minutes, for which he received a yellow card.
Bailey then appeared to shove the referee away in disgust and was lucky not to see a second yellow card.
Wells fired his spot kick low into the bottom left corner after a delay.
Huddersfield had claims for two more penalties when loan signing Grant Holt came off the bench on 64 minutes.
The Wigan player, who joined Town on Friday on a month’s loan, fell in the box under a challenge from Mark Beevers.
Shaun Williams then climbed all over Holt as the pair jostled for a high ball on 68 minutes – but both times the referee waved play on.
Lions substitute Mathias Ranegie was booked for a late lunge on Holt near the away dugout on 79 minutes.
Millwall’s top scorer Beevers nearly equalised on 70 minutes.
The centre back was only denied his third goal of the season when keeper Alex Smithies tipped away his header from an Upson cross.
Bailey was taken off on 73 minutes in a triple substitution as Lions boss Ian Holloway sought to get the visitors back in the game.
But instead Millwall lost their discipline with a series of rash challenges that led to a flurry of late bookings, including for Williams and Alan Dunne.
The Lions though could have nicked an equaliser in the fifth minute of stoppage time from a long throw.
Substitute Justin Hoyte’s throw was flicked on by Magaye Gueye but Ricardo Fuller headed just wide.