He didn't get a hit to snap his 0-for-20 streak, but he did get the RBI that put the Cardinals ahead and paved the way for their 6-3 victory.
Molina's hard grounder up the middle was misplayed by shortstop Brandon Crawford for an error, giving the Cardinals a 4-3 lead. Greg Garcia followed with a fielder's choice grounder to increase the lead to 5-3.
Trailing 3-1 when the half-inning started, the Cardinals cut the lead to 3-2 on back-to-back doubles by Matt Carpenter and Aledmys Diaz -- and then scored the next three runs without hitting a ball out of the infield.
A walk to Matt Holliday ended the night for San Francisco starter Jake Peavy. Reliever Hunter Strickland hit Stephen Piscotty on the right elbow with his only pitch of the night to load the bases. Matt Adams drove in the tying run with a single off first baseman Brandon Belt's glove, setting up Molina's at-bat.
Carlos Martinez (6-5) was the beneficiary of the Cardinals' four-run rally. He pitched six innings of three-run ball.
Peavy (2-6) he failed in his first attempt to become the fifth active pitcher with at least 150 career victories. He yielded four runs in five-plus innings.
The Giants loaded the bases with two outs in the seventh, but Kevin Siegrist retired Belt on a fly to left to end the threat.
Molina did break his longest career slump, 0-for-21, with a single in the eighth inning, only the seventh hit in his past 70 at-bats dating back to May 14. That helped the Cardinals score their final run, on a bases-loaded groundout by Randal Grichuk.
Trevor Rosenthal pitched the ninth to earn his 10th save. It was his second save in as many nights after he didn't have a save opportunity since May 18.
Grichuk, mired in a 3-for-32 slump, led off the St. Louis third with a double down the left line line, the first hit off Peavy. A sacrifice by Martinez moved Grichuk to third, and the runner scored on a single by Matt Carpenter, who collected his team-leading 36th RBI of the season.
The Cardinals' lead was short-lived. Martinez issued a two-out walk to Gregor Blanco in the fourth, and Jarrett Parker, playing in place of the injured Hunter Pence, followed by hitting the first pitch for his second home run of the season, putting the Giants up 2-1.
The runs snapped a streak of 14 consecutive scoreless innings for Martinez over three starts.
NOTES: SS Jhonny Peralta (thumb surgery) was 0-for-4 Sunday as he completed a minor league rehab assignment with the Class A Palm Beach Cardinals. He was 6-for-26 in nine minor league games and is expected to come off the disabled list on Tuesday, when the Cardinals play in Cincinnati. ... RHP Jerome Williams, signed as a free agent this week by the Cardinals, got the loss Sunday in his first start for Triple-A Memphis. He allowed three runs in five innings. ... The Giants are projecting that RHP Matt Cain (hamstring strain) will rejoin the rotation on June 13 to pitch against the Brewers. ... Surgery for Giants RF Hunter Pence's torn hamstring is set for Thursday. He is expected to miss about two months. ... The Giants completed a 10-game trip on Sunday night and will be home for the next eight games, starting Tuesday night against the Boston Red Sox.