Despite impressing at times since the Chilean's arrival, City's start to the domestic season has been hampered by their inability to win on the road.
Defeats at Cardiff and Aston Villa either side of a goalless draw have frustrated the title hopefuls, who broke their duck in style in east London.
Sergio Aguero opened the scoring early in the first half, before putting the visitors further ahead six minutes after half-time.
Ricardo Vaz Te's overhead kick reduced the deficit in style, only for David Silva to strike home after collecting a superb Aguero backheel to make it 3-1.
"I am very pleased," Pellegrini said. "The most important thing was to win the game, but I think that we continued playing the same way we were playing in the other games away.
"I was absolutely sure that if we continued playing in the same way we did against Aston Villa, we must win again.
"That is for me the most important thing here, winning the game and continuing to play the same way.
"It was very important (to get that first away win) because one point from nine is not a good average for us.
"Before we started the game, Chelsea, Arsenal and Everton had won their game, so we couldn't lose more points losing away, so these three points are very important for us."
Aguero was the standout player at Upton Park, with his movement causing the hosts problems from the outset.
"He is a top player," Pellegrini said of the man of the match. "He makes an important difference for us.
"It is also very important for the team that he didn't play the second game with Argentina (during the international break), so he was fresh. That was also very important."
While there were some nervy moments in the second half as West Ham threatened a comeback, anything but three points would have been harsh on City.
Only wayward finishing and the fine goalkeeping of Jussi Jaaskelainen kept the scoreline down, as they made light work of the six-man midfield that had seen West Ham win 3-0 at Tottenham last time out.
"We knew that West Ham would play in the way they played against Tottenham," Pellegrini said.
"They played very well in the last game, so I spoke with the players to have patience and to move the ball until we find the space.
"I think we did it very well. We scored three goals and the goalkeeper was the best player of West Ham. He had at least four or five important saves."