Hamels (14-7) gave up solo home runs to Yuniesky Betancourt and Corey Hart, but kept Milwaukee from mounting any big innings in a game between two best teams in the National League. The left-hander pitched his third complete game of the year, walking two and striking out two.
The Phillies managed only one hit off Chris Narveson (10-7) in the first 5 2-3 innings, but then broke through for six runs by getting seven consecutive batters on base to chase the Milwaukee starter in the sixth. Philadelphia had 11 of its 12 hits in the final 3 1-3 innings to win its fourth straight.
Pence also had a run-scoring double in the ninth and finished with three RBIs. It was his first game at Miller Park since July 29, when Houston manager Brad Mills removed him in the fifth inning and told him he had been traded to the Phillies.
Philadelphia played without Ryan Howard, Chase Utley and Jimmy Rollins, who was activated from the disabled list before the game. Even without the three stars, each of the eight position players in the starting lineup had at least one hit.
For the first half of the game, Narveson was on cruise control, not allowing a hit until John Mayberry Jr. hit a bloop single to right-field in the fifth. With the Brewers leading 1-0, the left-hander struck out Michael Martinez and Hamels to open the fifth but then fell apart and didn't retire another batter.
After Hamels struck out, Shane Victorino doubled off the top of the wall in the left-field corner on the first pitch, and Wilson Valdez followed with a double to center to tie the score at 1-all.
Placido Polanco walked and Pence hit a line drive bouncing to the center-field wall, scoring both runners for a 3-1 lead.
Mayberry then reached on an infield single, driving in Pence for a 4-1 lead. Replays showed Mayberry was out on a close play, but first base umpire Angel Hernandez called him safe.
Mayberry promptly stole second base and scored on Carlos Ruiz's double. Ben Francisco then singled to score Ruiz for a 6-1 lead, chasing Narveson.
Narveson finished allowing six runs, seven hits and two walks while striking out two.
Betancourt snapped a 7-for-45 slump with his 11th homer to give Milwaukee a 1-0 lead in the fifth. Hart's 24th home run brought Milwaukee within 6-2 in the sixth.
Pence's double in the ninth made it 7-2.
NOTES: Pence's three RBI gave him 400 for his career. . Hamels has 11 wins in September since 2008, the most of any NL pitcher. . Milwaukee CF Nyjer Morgan did not start one night after being ejected in St. Louis. Morgan entered the game in a double-switch in the sixth, and usually does not start against left-handed pitchers. . Victorino's sixth-inning double off the top of the wall was reviewed by the umpires, who took 65 seconds to watch a replay and confirm it was a double and not a home run. . Milwaukee 2B Rickie Weeks was reinstated from the DL before the game but did not play. . Brewers RHP Shawn Marcum will face the Phillies RHP Roy Halladay in game two of the four-game series Friday night. Marcum is only 2-2 in his last five starts, but has a 1.04 ERA in that span. Halladay is 2-1 in his last five starts with a 2.16 ERA in that period.