Pablo Sandoval homered and had five RBIs to back an uneven start by Madison Bumgarner as the Giants beat the St. Louis Cardinals 13-8 on Sunday.
Andrew McCutchen and Alen Hanson each added three hits. Brandon Belt and Gorkys Hernandez had two apiece to help the Giants split the four-game series.
Bumgarner (2-3) earned his second win this season despite an erratic outing. Making his seventh start after missing the first two months with a broken left pinkie, Bumgarner allowed four runs and seven hits in 5 1/3 innings. He walked two and hit a batter with a pitch.
The Giants bailed out their ace with a pair of three-run innings and a five-run sixth while setting a season high for scoring.
After Jose Martinez's RBI single off Bumgarner in the fifth put St. Louis ahead 4-3, San Francisco rallied against reliever John Brebbia.
Belt doubled and went to third on All-Star Brandon Crawford's single. Sandoval followed with his eighth home run, a three-run drive that bounced into the waters of McCovey Cove.
Sandoval added a two-run single in the sixth. The five RBIs were one shy of his career high.
Brebbia (1-3) also took the loss against the Giants on Friday.
Matt Carpenter hit his 17th home run and Yairo Munoz also went deep for St. Louis.
Cardinals starter Jack Flaherty gave up three runs, two earned, in 2 1/3 innings.
All-Star RHP Miles Mikolas (9-3, 2.63 ERA) starts Tuesday in Chicago against the White Sox.