After a dour opening 45 minutes that Saints dominated, it took less than a minute of the second half for Mark Noble to break the deadlock.
Kevin Nolan doubled the Hammers' advantage moments later and although Adam Lallana halved the deficit, Noble's penalty and a superb strike by substitute Modibo Maiga sealed an emphatic victory for the hosts.
"It was a surprise we won 4-1 when you look at what we did in the first half," Allardyce said after the match.
"The good thing for us is the professionalism of players that took a little bit of criticism at half-time for what was a bit of a lacklustre performance.
"The only good thing we did was not to allow Southampton any real chances in the first half.
"We were just not playing well enough and, if we were to overcome them, we had to play better than that and we had to do that by upping the tempo and showing the sort of desire we showed against Arsenal, Fulham, Sunderland and Aston Villa this year.
"Of course, doing that in the second half and giving that sort of performance and scoring the goals - obviously the timing was brilliant because we went out, got right at them and scored two very quick ones - gave us a fantastic 4-1 victory.
"We can forget the first half now and just enjoy the victory and really focus on the positives of how we turned the game around when we looked like we were struggling. In fact, we didn't look like we were struggling, we were.
"To come out and put it right, not just in terms of winning the game but winning the game comfortably is great.
"Scoring four goals against any side in the Premier League is no mean feat and 4-1 is a brilliant result for us."
The win was the Hammers' fourth since their return to the top flight, while Saints have only four points to show from their opening fixtures - something Allardyce highlighted during the half-time break.
"We had to look at ourselves and say 'we're just not doing our job properly' apart from we defended okay," the former Bolton and Newcastle boss said.
"We weren't passing it well enough, mixing our play well enough, we weren't putting the right quality to the front lads, we weren't sustaining any pressure on the opposition.
"I said 'we need to sustain pressure on this opposition as this team is struggling confidence-wise. They've only picked up four points and they score plenty of goals, but conceded 20. If we put pressure on the back four they will make mistakes'.
"And certainly they did that and we capitalised on that."
Saturday's result means Southampton have now conceded 24 goals in just eight matches back in the Premier League.
It is a record that has cost the south coast side this campaign and will no doubt see the position of manager Nigel Adkins come under scrutiny.
Asked how long he thinks he will have to turn things around, the Saints manager said: "Honest answer? I don't know. That is football, I am being brutally honest with you.
"There is a vision at the football club to play a certain brand of football by passing the ball.
"There needs to be stability at any football club, which is important. But I am not naive as it's football and football is a results-driven industry.
"We've got a process in place that we're doing our best to adhere to, but you've got to win games of football.
"You've got to keep it out at one end and stick it in at the other end.
"On too many occasions this year in the Barclays Premier League, we've not kept it out of our net and I am being up front and honest with you."