Updated

Adrian Gonzalez went 3-for-3 with a homer and three RBI as the Los Angeles Dodgers edged the St. Louis Cardinals, 5-3, in the middle test of a three-game set at Dodger Stadium.

Mark Ellis and Juan Uribe both added RBI doubles for the Dodgers, winners in three of their last five games. Nick Punto went 3-for-4 and scored a pair of runs in the triumph.

Paco Rodriguez (1-2) earned the win after tossing one perfect inning in relief. Brandon League hurled a scoreless ninth to pick up his 10th save of the season.

Starter Ted Lilly gave up two runs -- one earned -- on two hits over 5 1/3 innings, his first outing since returning from the disabled list on May 20. Lilly landed on the DL after suffering a right rib cage strain. The 37-year- old southpaw also missed the first 19 games of the season while recovering from surgery on the labrum in his left shoulder.

"I was hoping to go a little deeper. My timing was a little in and out and my command wasn't as sharp, but it was the best I've thrown the ball in a long time," said Lilly.

Yadier Molina went 3-for-4 with an RBI and a run scored, while David Freese and Pete Kozma chipped in with one RBI apiece for the Cardinals, who had won three-straight games entering the contest.

Seth Maness (3-1) was charged with the loss after giving up the go-ahead run in the sixth inning.

Starter John Gast was forced the leave the game in the second inning with an apparent shoulder injury. He allowed one run on one hit and two walks before exiting the contest.

"I didn't like the loss, and I didn't like losing our pitcher, but I liked our guys fight. We just couldn't capitalize on opportunities," said Cardinals manager Mike Matheny.

St. Louis jumped out to an early lead in the first inning. Matt Carpenter singled, moved to second on a fielding error by Punto then scored on Molina's double. Molina lifted a soft fly ball to left-center field that Scott Van Slyke laid out for, but the ball bounced off his glove allowing Carpenter to come around.

The Dodgers answered with a run of their own in the home half. Punto walked and Gonzalez followed two batter later with a double to center.

Gonzalez added an RBI single in the third to put Los Angeles on top 2-1. Punto opened the frame with a double and Ellis was hit by a pitch to put two on with no outs. Gonzalez followed with a base hit to center to score Punto.

Gonzalez continued to brutalize St. Louis' pitchers in the fifth, clubbing a solo homer to make it 3-1,

The Cards, though, tied it up with a pair of runs in the sixth inning.

With two on and two out, Freese cracked a double to center to score Allen Craig. After Ronald Belisario was internationally walked to load the bases, Pete Kozma ripped an infield single to the left side, plating Molina.

The Dodgers added one in the home half to take a 4-3 edge. Crawford reached on a Carpenter fielding error then scored on Ellis' double to left.

Uribe's RBI double in the eighth accounted for the final margin.

Game Notes

Gonzalez also walked twice ... The Dodgers were just 2-for-12 with runners in scoring position ... Los Angeles holds a slim 1,009-1,007-16 advantage over the Cardinals in the all-time series ... St. Louis lost on the road for just the ninth time this season.