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."