After a goalless first half when the best chance fell to West Ham’s Lucas Perez, who scuffed his shot wide, Southampton went ahead with the scrappiest of goals.
Lukasz Fabianski denied first Nathan Redmond and then Oriol Romeu before Redmond bundled the ball into the net five minutes after the break.
But Southampton's lead lasted under three minutes as Felipe Anderson struck a powerful equaliser from 20 yards.
Anderson then finished off a slick counter-attack on 59 minutes for his seventh goal in nine PL matches.
A third consecutive away win lifts West Ham to ninth, on 27 points. Southampton stay 16th on 15 points after their winning run was ended.
Southampton: 30 Dec v Man City (H)
West Ham: 30 Dec v Burnley (A)