PHOENIX -- The Diamondbacks didn't exactly start out their second half the way they would have liked.

Facing the Dodgers for the first time since April, when the D-backs were on a tear, Arizona couldn't relive the magic three months later as it fell to the Dodgers, 8-7, in an 11-inning, four-hour, 15-minute marathon at Chase Field.

Dodgers first baseman James Loney hit a game-winning homer off Arizona reliever Doug Slaten to lead off the top of the 11th inning.

More important, the D-backs (47-49) lost their grasp on first place in the National League West standings and now sit in a deadlock with the Dodgers with two games left in the series.

"A lot of times in a game like that, one pitch will end up costing you, and it did," D-backs manager Bob Melvin said. "Loney got a good pitch to hit."

A combined seven runs were scored in the first inning, with the Dodgers scoring three runs off starter Doug Davis. The D-backs countered with seven runs of their own through the first three innings. The D-backs strung together five consecutive singles in the first inning en route to a four-run first.

"Both teams offensively did some good things in the first inning," Melvin said. "It ended up being a good game, but we had a few more opportunities with some guys left on base."

Eleven, to be exact. The D-backs went 4-for-16 with runners in scoring position and left the bases loaded with one out in the sixth inning. The Dodgers, on the other hand, left just six on base and went 2-for-7 with runners in scoring position.

The D-backs nearly won the game in the bottom of the ninth inning. With runners on first and third, Augie Ojeda hit a ground ball down the third-base line, but Blake DeWitt snared the ball and made a nice throw to rob Ojeda of a game-winning hit.

"If he bobbles that ball or doesn't come up cleanly to make a good throw, we end up winning the game," Melvin said.

Slaten (0-3) picked up the loss. He left the game after his surgically repaired knee started to bother him and was lifted from the game just two batters after allowing the home run to Loney.

Reliever Chad Qualls was unavailable to pitch. He was warming up in the bullpen to start the seventh inning but felt tightness in his lower back. Qualls said he originally tweaked a muscle two days ago while bending over and said it has happened two other times this season.

Instead, Leo Rosales pitched the seventh and blew a save, allowing a tying homer to Matt Kemp.

"I started getting going in the seventh inning and I thought I was in there," Qualls said. "It was a little sore, a little tight and during the pitching change they decided to go with Rosie. I guess they're just more on the safer side."

There were a combined 39 players and 15 pitchers used between the two teams in the NL West showdown.

Both starting pitchers had outings they would like to forget. Davis lasted just three innings and Dodgers starter Hiroki Kuroda was knocked out after the second inning, both picking up no-decisions.

The Dodgers had seven extra-base hits, including a season-high four homers -- two by Nomar Garciaparra and one each by Loney and Kemp.

"It probably wasn't [Davis'] best command," Melvin said. "It looked like after the first inning he started to pitch a little bit better and then the home run by Garciaparra -- it looked like his command started to waver a little bit after that."

The D-backs' Nos. 2-4 hitters -- Conor Jackson, Orlando Hudson and Chad Tracy -- went 6-for-6 through the game's first three innings, scoring a combined five runs.

In his first at-bat back with the D-backs, Tony Clark struck out after receiving a standing ovation to lead off the bottom of the ninth inning.

"It was one of those games where they jumped on us early, but we fought back," center fielder Chris Young said. "Our offense had a good night tonight. We came through, got some big hits, and we battled. When it gets to the point to where it was tonight, at that point the game can go to anybody."