That brought up Carpenter, who lined a solid hit to left, extending the St. Louis lead to 5-2.
Jay finished 4-for-4 with two RBI as the Cardinals took the opener of a four-game set.
Jake Westbrook (11-8) held the Giants to two runs on seven hits over six innings, collecting the victory.
Cain ended up yielding five runs on eight hits over 5 2/3 frames.
Angel Pagan and Buster Posey homered for San Francisco, which came into the contest with a half-game lead over the Los Angeles Dodgers in the National League West.
Susan Sarandon 'very excited' about daughter's pregnancy
Dennis Rodman pledges to end trips to North Korea