There were 3,892 in a 13,480 crowd at Wigan Athletic, where the Bermudian struck after 81 minutes to keep his side’s promotion bid on the boil.
Wells scored in stoppage time to salvage a draw against Blackburn Rovers on Saturday, when Town dominated.
This time, his seventh goal of the season brought all three points in a contest which was far more even.
It was a third consecutive away win for Town, a sixth of the season on the road and a 14th overall in match number 25.
Town were trying to exploit Wigan’s dismal recent record, with Saturday’s goalless draw at Derby County following five successive defeats since the Latics’ 2-1 victory over Wagner’s men at the John Smith’s Stadium in November.
Wigan, second from bottom beforehand, had lost their previous five matches at the DW Stadium and failed to score in seven of their last nine home games.
The Latics made the early running and forced two corners in the opening three minutes, with Aaron Mooy heading both of them clear.
Town, looking a little hesitant on a bobbly surface, also had to deal with a couple of free-kicks pumped into their penalty area.
When Nick Powell broke from midfield in the 11th minute, Hudson was on hand to shepherd the ball back to keeper Danny Ward as Yanic Wildschut lurked.
Former Manchester United man Powell was causing the visitors a few problems, with Billing booked for fouling him.
When Town did manage to get a delivery into the Wigan area, 41-year-old keeper Jussi Jaaskelainen calmly collected Cranie’s deep cross towards Nahki Wells.
Wagner’s side were struggling to get their passing game going, and were unable to make anything of a 27th-minute corner won by the busy Cranie.
Mooy’s flag kick found its way to Payne, but the former Southend United man sliced his effort well off target.
Bunn drove wide from the edge of the area before Holmes-Dennis made a vital headed clearance as Wildschut rose to meet a Jacobs cross in the 33rd minute.
Wigan’s Jacobs drove over from distance while home defender Jake Buxton steered a tricky Mooy cross to safety.
Mooy then went into referee Jeremy Simpson’s book for a foul on Will Grigg in first-half stoppage time.
Town made a lively start to the second half, but another Mooy corner was cleared while Wigan stood firm against a couple of neat crosses from Holmes-Dennis. The Town left-back was then booked for illegally halting a Wildschut counter-attack in the 55th minute.
Joe Lolley replaced Bunn after 59 minutes, making his first appearance since suffering a foot injury in August.
Wildschut lashed a 64th-minute drive narrowly wide as the game started to open up a touch.
Wagner made his second change, Whitehead for Billing, on 66 minutes.
Soon after Jake Buxton’s tackle thwarted Payne as he chased an Elias Kachunga pass.
Stankovic was yellow carded for a 78th-minute foul on Jacobs, who had himself been booked for bringing down Wells - the latter's persistence almost bringing a mistake from Jaaskelainen soon after.
The breakthrough finally came in the 81st minute, when Wells finished after the Finnish keeper could only parry Kachunga’s drive.
Michael Hefele replaced Payne ahead of four minutes of stoppage time.