PHOENIX -- Dan Haren pitched for the National League in the All-Star Game earlier this month.

Facing the Phillies lineup Tuesday night, the right-hander said it felt like déjà vu.

"I don't know what was harder, that or the All-Star team lineup," Haren said. "That's basically the All-Star lineup right there."

It was a lineup that made Haren throw lots of pitches early on and capitalized on the smallest of mistakes to beat the D-backs, 4-3, at Chase Field.

Haren (10-6) fought the Phillies to a 1-1 stalemate through four innings, with the lone runs coming on homers from Arizona's Ryan Roberts in the first frame and Philadelphia's Shane Victorino in the third.

But while Haren was able to keep the potent Philly lineup in check, it came at a cost. Through three innings alone, he had thrown 71 pitches, and ended his outing with 117.

"I made some good pitches and they kept fighting it," Haren said.

It was part of the game plan the Phillies used against one of the NL's best hurlers.

"We had a couple of good at-bats early, and we got his pitch count up," Victorino said. "A guy like that, you want to get him out of the game as quick as you can, however you can. We were able to do that tonight."

The breaking point for Haren came in the fifth inning, when the Phillies were able to capitalize on a pair of errors to score two runs and grab a 3-1 lead.

Stephen Drew bobbled a Jimmy Rollins grounder with one out and a runner on second, and Victorino followed with a ground-rule double down the right-field line that was just barely fair -- or foul -- depending on which dugout you were sitting in.

Rollins came around to score when Chad Tracy's throw to the plate on a grounder to first sailed over the head of catcher Miguel Montero.

"Unfortunately, in that fifth inning, I couldn't get out of that unscathed," Haren said. "There were a couple of errors that inning, and any time you give that good of a team an extra out or two, that's a pretty tough task."

Miscues like the ones in the fifth inning have been an all too common occurrence for the D-backs this year. It's one of the reasons they took pregame infield and outfield practice Tuesday, though the results were not evident during the game.

"It seems like I've said this time and again," D-backs manager A.J. Hinch said. "If we don't execute, we're going to have these peaks and valleys."

Having watched Haren throw all 117 of those pitches in what tied his shortest outing of the year, Hinch decided to remove his ace after five.

"They put together a pretty good game plan against Dan," Hinch said. "They were going to wait him out. They did damage when they hit early in the count, and they fouled off a ridiculous amount of balls against him and just kind of systematically took him out of the game."

The Phillies added a key insurance run in the seventh, when Jayson Werth's groundout scored Victorino from third.

While Haren made an early exit, Phillies starter Cole Hamels held the D-backs to just one run on four hits over eight innings. The left-hander did not allow a walk and struck out nine as he raised his record to 7-5.

"He's a great pitcher and he showed that tonight," D-backs third baseman Mark Reynolds said.

The D-backs made things interesting in the ninth off closer Brad Lidge.

Justin Upton led off the frame with a walk and Reynolds followed with a blast to left that landed in Friday's Front Row Sports Grill some 464 feet from home plate.

Lidge, though, settled in and retired the next three batters to record his 20th save.

"We need to stay focused out there and make the plays when it's your turn," Reynolds said, referring to the errors that wound up being pivotal. "There's no doubt that the miscues are costing us games.

"To be a winning team, you've got to make plays. We're not doing it."