The Hammers were held to a 1-1 draw in normal time, but emerged victorious after a penalty shootout.
They won the shootout 7-6, which was enough to see them lift the Betway Cup.
"I was very happy with our performance," Pellegrini said after the game to whufc.com.
"It was better if you compare that with the last game we played before we came to Austria [against Ipswich Town].
"We drew 1-1 but I think we always had good build-up, recovered the ball well and pressed well and this is a Mainz team who try to have possession and we had more possession than them, so in a tactical way we improved a lot compared with the last game.
"We had a lot more options than they had and Adrian really didn't have too much work during the game, so in the way that we improved from the friendly games, it's good for the team."