Pham’s two home runs came off of Brewers starter Wily Peralta, who also surrendered a solo home run to Matt Carpenter. Peralta lasted just four innings, falling to 5-9 with a 4.41 earned run average.
The Cardinals improved to 10-4 against the Brewers this season and 27-10 in their last 37 games played at Miller Park.
The Brewers scored four times in the fourth inning to make it close. Martin Maldonado clubbed a three run home run in the frame, his first home run since May 31. But the Brewers managed only two hits over the last five innings.
Jaime Garcia gave up all four runs in six-and-a-third innings for the win. He improved to 9-5. Trevor Rosenthal earned his 45th save.
The Brewers will try to avoid a sweep when they face the Cardinals again tonight.