Updated

Ryan Howard hit a tiebreaking two-run homer, Jayson Werth and Cody Ransom also connected, and the Philadelphia Phillies beat the Arizona Diamondbacks 9-5 for a season-high sixth straight win Tuesday night.

The two-time NL champion Phillies moved within 3½ games of East-leading Atlanta, cutting the deficit in half over the last five days. They've won nine in a row at home, their longest since winning 16 straight at Veterans Stadium in 1991.

David Herndon (1-2) allowed two runs — one earned — in one inning to record his first major league victory.

Mark Reynolds hit his 24th homer for the Diamondbacks, who have the third-worst record in the majors.

It may have been a costly win for Philadelphia. Center fielder Shane Victorino left in the seventh with a left oblique strain. He'll be examined by a team physician on Wednesday.

The Phillies played without Jimmy Rollins, who has a bruised left foot. They're already missing Chase Utley.

After the Diamondbacks scored two runs off Herndon in the sixth to go up, the Phillies answered with three in the bottom half to take a 7-5 lead.

Raul Ibanez hit a two-out RBI single off Jordan Norberto (0-1) to tie it at 5. Howard followed with an opposite-field drive to left-center.

The 2006 NL MVP has been Philadelphia's most consistent hitter in a lineup that's been riddled by injuries and inconsistency. The All-Star first baseman is batting .302 with 23 homers and a NL-leading 81 RBIs.

Ransom hit a two-run shot off Chad Qualls to make it 9-5 in the seventh. Werth crushed a 1-2 pitch from starter Rodrigo Lopez into the bushes behind the center-field wall for a 4-3 lead in the fifth.

Both starters pitched five innings. Cole Hamels allowed three runs and six hits, striking out eight. It was his shortest outing since lasting four innings against Toronto on June 26. The 2008 World Series MVP finished the month with a 2.16 ERA in six starts, but only got one win.

Lopez gave up four runs and seven hits against his former team. He was 3-1 in seven games with the Phillies last year.

The Diamondbacks went up 5-4 on a quirky play in the sixth. Chris Young led off with a double and Kelly Johnson walked. Gerardo Parra reached on Howard's throwing error and scored on Adam LaRoche's sacrifice fly to tie it at 4. Miguel Montero followed with a grounder to second baseman Placido Polanco. Parra ducked from Polanco's tag and beat the return throw from Howard to second, allowing the go-ahead run to score.

Reynolds hit a solo shot to tie it at 2 in the fourth. He walked with the bases loaded to force in Arizona's first run in the first.

Hamels hasn't had much luck this season. He's just 7-7 despite giving up three earned runs or less in 17 of his 21 starts and two or less 11 times.

Notes: Upton left in the fifth with tightness in his right hip. He extended his hitting streak to 13 games with a first-inning single. ... Phillies LHP Jamie Moyer will get a second opinion on his injured left elbow from renowned surgeon Dr. Lewis Yocum in Los Angeles on Wednesday. ... Hamels needed 31 pitches to get out of the first inning. ... A crowd of 44,379 was the 89th straight sellout at Citizens Bank Park.