Charlie Austin came off the bench to deliver the final blow after 10-man West Ham had fought back from two goals down.
Austin tucked his first goal of the season away from the penalty spot three minutes in added time in a 3-2 win at St Mary’s.
The forward’s goal denied Javier Hernandez, who struck twice, a share of the honours.
“It was great to get the first win of the season and come on and play a part,” Austin told the Official Southampton FC Website.
“It’s always tough when you go against 10 men — they have nothing to lose and just go for it.”
Southampton appeared to be cruising towards their first victory when Hernandez levelled 15 minutes from full-time.
But Pablo Zabaleta gave the hosts a lifeline when he bundled over Maya Yoshida in the area, before Austin converted from 12 yards out.
“We threw a two goal lead really and I’ve got to be honest, we have to gel,” said Austin. “We’ve come away with three points, delighted, it’s a big win for us.”