Jarrod Bowen marked his first start following a deadline-day move from Hull by firing the Irons ahead with a chipped finish in the 15th minute.
Southampton then equalised in the 31st minute when Michael Obafemi converted a cutback from James Ward-Prowse.
The 19-year-old met the ball on the bounce and guided it deftly past Lukasz Fabianski in the West Ham goal to put the pressure on the home side.
West Ham, however, regained the lead five minutes before half-time as Sebastien Haller slotted in from a tight angle.
Southampton goalkeeper Alex McCarthy was visibly frustrated as he felt the striker had fouled him in the lead up to the finish, but a VAR check saw the goal stand.
Michail Antonio made it 3-1 in the 54th minute after being put clear by Pablo Fornals’ lofted pass – the Spaniard’s second assist of the afternoon - sealing victory for the hosts.
David Moyes’ side moved up to 16th with the win, two points clear of Aston Villa, who drop into the bottom three but have a game in hand.