The visitors found an unlikely match-winner in Wanyama, who scored his first goal for the Saints since signing from Celtic with an excellent angled finish just as Swansea looked like withstanding intense second-half pressure.
Swansea boss Garry Monk saw his main talisman Wilfried Bony sent-off six minutes before half-time after picking up two yellow cards, both for rash tackles on Maya Yoshida.
Referee Jon Moss was at the centre of plenty of controversy and brandished his yellow card six times in a feisty encounter.
Ronald Koeman’s troops made hard work of their win after having plenty of possession in the second 45 minutes, but they did find a way through 10 minutes from time thanks to Wanyama’s close-range toe-poke which flew into the far corner to give Southampton their third consecutive victory.
There was little time for a response from the 10-men of Swansea, who suffer back-to-back defeats. Meanwhile, Saints leapfrog them at the business end of the Premier League table.
Roy Hodgson was visiting the Liberty Stadium for the first time in his capacity as England manager and there were two fascinating battles on the flanks for him to assess.
Nathan Dyer was up against Ryan Bertrand and Nathaniel Clyne was marking Wayne Routledge, and the Swansea wingers enjoyed early success.
Routledge sent over an excellent 12th-minute cross but Dyer was unable to make a proper connection and Bertrand cleared the danger.
Swansea were calling the shots in the early stages and Gylfi Sigurdsson fired straight at Fraser Forster in the Saints goal before Routledge sent an ambitious volley wide.
The temperature levels rose as Bony and Jose Fonte picked up bookings for fouls and Yoshida was also cautioned for dissent after Dyer clattered into Shane Long.
Swansea almost took a 28th-minute lead when Sigurdsson slipped through Routledge and the winger, choosing to shoot with the outside of his right foot, struck the top of the crossbar.
Southampton had not offered much in attack but a free-flowing move involving Dusan Tadic and Bertrand ended with Graziano Pelle scuffing a shot which Lukasz Fabianski comfortably collected at his near post.
But Saints were fortunate to survive when Bony met Sigurdsson’s corner and Bertrand was in the right place to clear off the line. It was Bony’s last positive involvement as he soon saw red.
Southampton inevitably dominated the second period, both in terms of possession and territory, as Swansea left Sigurdsson up front on his own and retreated deeper and deeper towards their own goal.
Tadic’s deflected drive ended up on the roof of the Swansea net and Clyne crossed for Pelle to send a header straight at Fabianski on his goal-line.
The Serbian was really starting to pose problems down Swansea’s right and his cross found the head of Pelle, whose header forced Fabianski to tip over.
Pelle had an even better opportunity when substitute Steven Davis picked him out. The unmarked Italian headed wide from 10 yards, but the striker redeemed himself when he sent Wanyama through for the decisive goal 10 minutes from time.
Paul Merson on Swansea 0-1 Southampton
Bony got two stone-wall bookings and they completely changed the game. Swansea were the better team and they were getting on top. I have never seen a team looking so comfortable with 11 men against 10; Southampton completely dominated but the winner came from real luck. When Wanyama came on I’ve never seen a manager look so disappointed at bringing a player on. He didn’t want to put him on, but he was the difference in the end and got a great goal. After that they were as comfortable as can be.
I love people who celebrate goals. It’s the best feeling in the world, playing football and scoring a goal but he just stood there and looked at everybody as if to go ‘I’ll do it again next week’. He won’t!