ST. LOUIS -- The offense-starved Los Angeles Dodgers tried James Loney in the third slot for only the fourth time all season. He looked right at home there.
Loney's two-run, ninth-inning home run off Adam Wainwright snapped a scoreless tie and the Dodgers held on to beat the St. Louis Cardinals 2-1 on Friday.
"We started a little slow tonight," Loney said. "It was a good pitching duel, but basically somebody's got to win."
Before Loney hit his fifth homer into the right-field seats on an 0-1 pitch, the Dodgers had been on the verge of being shut out for the fifth time in seven games. After Russell Martin singled, Loney homered for the first time since July 24.
"These bats will get going," manager Grady Little said. "We've got too many good quality hitters not to bust out. It'll happen."
The homer was the first allowed by Wainwright (10-9) in seven starts covering 48 1/3 innings. Cardinals pitchers had thrown 25 consecutive scoreless innings before the homer by Loney, who just missed a homer in the fourth on a drive that sailed just foul.
Wainwright allowed two runs and six hits in his first career complete game, striking out five and walking one. On the decisive pitch, he tried unsuccessfully to come inside on Loney.
"It's definitely not how you want to end the game," Wainwright said. "It probably wasn't the best pitch selection."
Brad Penny worked seven innings of five-hit ball for the Dodgers, who won for only the second time in eight games. Joe Beimel (3-1) allowed an intentional walk in the eighth, Albert Pujols on a 2-0 count with no one on and two outs, and Takashi Saito worked out of trouble for his 29th save in 32 chances.
Saito allowed a leadoff walk to Jim Edmonds and a one-out single to Rick Ankiel. Yadier Molina followed with his third hit of the game, an infield hit off the glove of diving third baseman Nomar Garciaparra, to cut the gap to 2-1. Saito struck out pinch-hitter Ryan Ludwick and Adam Kennedy, the latter on a pitch in his eyes, to end the game.
"I dug myself a hole," Saito said through an interpreter. "But we were able to win the game somehow."
Ankiel, the former pitcher who hit a three-run homer on Thursday in his major league debut as an outfielder, went 1-for-4 for the second straight game. He has struck out four times in eight at-bats.
Penny struck out six and walked three in an outing that lowered his ERA to 2.54. The Cardinals were 0-for-5 with runners in scoring position against Penny, with Jim Edmonds and Pujols grounding into double plays with two on to end the first and fifth.
"I had all three pitches I could throw for strikes, and that helped a lot," Penny said. "I always tell myself, good pitching gets good hitting out."
Shortstop Rafael Furcal went behind the bag at second to snare Pujols' bouncer in the key defensive play for the Dodgers.
"That's probably the difference in the game," Penny said.
Molina singled his first two at-bats, giving him five straight hits with a walk over two games, before flying out in the seventh.
Edmonds robbed Martin twice with running catches, one near the center-field wall in the first and swooping in to snare a sinking liner to end the sixth.
Molina has thrown out 16 of 30 runners attempt to steal after easily catching Rafael Furcal trying for second in the fourth. ... Penny has made six straight quality starts and has an NL-high 21 in 24 starts overall. ... Wainwright, who has the Cardinals' only complete game this season, threw eight innings of one-hit ball at Kansas City on June 13 in his previous long outing. ... Wainwright was whipped by the Dodgers on May 15 in Los Angeles, allowing a season-high eight runs in a season-low 2 2/3 innings. ... Garciaparra has batted third in 65 games, most on the Dodgers, and Martin has done it 42 times.