A.J. Ellis worked a four-pitch, bases- loaded walk in the bottom of the ninth to lift the Los Angeles Dodgers over the St. Louis Cardinals, 6-5, in the opener of a three-game series at Dodger Stadium.
Ellis finished with two RBI, while James Loney added three hits, knocked in two runs and scored once for the Dodgers, who won for the seventh time in nine games.
Kenley Jansen (3-0) allowed the game-tying home run to pinch-hitter Lance Berkman in the top of the ninth, but was bailed out in the home half of the frame to earn the win.
Fernando Salas (0-2) gave up the deciding run to suffer the loss.
Matt Holiday also homered for St. Louis, which has dropped six of its last eight.
The Cardinals entered the ninth inning trailing 5-4 and Jansen seemed to be in line for his fifth save of the year when he struck out the first two batters of the frame, but Berkman stepped up next and pulled the second pitch of his at-bat over the right-field fence to knot the game at five.
Salas then entered for the Cardinals in the bottom of the frame and issued a leadoff walk to pinch-hitter Elian Herrera. Two batters later, Adam Kennedy pulled a base hit through the right side of the infield to place runners on the corners with one out.
After Loney was issued an intentional walk to load the bases, Salas could not find the strike zone with four straight fastballs to Ellis, allowing Herrera to jog home for the game-deciding run.
"Once he fell behind in the count I waited for a good pitch to hit but no one was to my liking," said Ellis.
The Dodgers struck first in the bottom of the second inning with consecutive one-out doubles by Kennedy and Loney. Ellis followed with a base hit to left to plate Loney before rounding the bases on a Tony Gwynn Jr. triple to right field.
Gwynn would be stranded at third, though, as Ted Lilly went down swinging and Dee Gordon grounded out to second to keep it a 3-0 game.
St. Louis quickly answered in the third inning to take the lead.
Tyler Greene started the inning with a single and after advancing to second on an errant pickoff attempt by Ellis, Shane Robinson fanned on a 1-2 curveball, but the ball got past Ellis and Robinson took first on the wild pitch.
A Lance Lynn sacrifice bunt moved the runners to second and third before Rafael Furcal lifted a sacrifice fly to center field to bring home Greene.
Holliday then followed Matt Carpenter's RBI single with a blast into the left- field bleachers to put the Cardinals on top 4-3.
But Mark Ellis singled, moved to second on a Bobby Abreu walk, advanced to third on Andre Ethier's flyout and came home on a Kennedy base hit in the home third to tie the game at four.
After stranding the go-ahead run on second in the fourth inning and third in the fifth, the Dodgers were able to break the tie in the seventh off reliever Marc Rzepczynski thanks to a costly error by the Cardinals.
Ethier hit a grounder to second following Abreu's one-out single for what could have been an inning-ending double play, but Furcal's relay throw to first sailed over the head of Carpenter, allowing Ethier to take second.
Two batters later, Loney flared a base hit to shallow left field to score Ethier and give Los Angeles a 5-4 advantage.
"The bulk of the reason why we lost, we were letting them get deep in the count," said Cardinals manager Mike Matheny. "That and defensive mistakes really cost us."
St. Louis placed outfielder/first baseman Allen Craig and pitcher Kyle McClellan on the 15-day disabled list, and recalled outfielder Adron Chambers and pitcher Brandon Dickson from Triple-A Memphis earlier Friday...Dodgers manager Don Mattingly was thrown out of the game in the third inning for arguing a check-swing call...Los Angeles has won five straight games against the Cardinals...A.J. Ellis has now reached base safely in 27 straight games...Lilly started the game for LA and allowed four unearned runs on four hits with six strikeouts through seven innings, while Lynn gave up four runs on nine hits and two walks in a six-inning start for St. Louis.