The Hammers have lost their opening three fixtures in the Premier League, and League One outfit Wimbledon took an early lead in Tuesday night's tie.
However, West Ham netted three times in the final half-hour to claim the win, and Pellegrini has admitted that he was relieved to have got his first victory on the board.
The Chilean is quoted by the London Evening Standard as saying: "It was important because when you continue losing, you need to win, the mind of the players, they need to continue trusting, the fans the manager the players.
"We did our duty to eliminate Wimbledon but if we were the team eliminated it would have caused a lot of damage so we finished this game and now we will think about next one."
West Ham are next in action when they host Wolverhampton Wanderers on Saturday afternoon.