SAN FRANCISCO -- Ryan Vogelsong and Sandy Rosario combined to shut out the Pittsburgh Pirates on three hits, and Pablo Sandoval broke open a tight game with a two-run triple in the eighth inning as the San Francisco earned a series split with the National League Central co-leader with a 4-0 win Sunday afternoon.
In recording their first back-to-back wins at home in more than a month, the Giants denied the Pirates a chance to go a game up on the St. Louis Cardinals, who lost earlier in the day to the Atlanta Braves.
Vogelsong (3-4), a former Pirate, pitched easily his best game of the season, allowing only third-inning and seventh-inning singles by Andrew Lambo and Andrew McCutcheon, respectively.
The former All-Star, who entered the game with a 6.29 ERA, went eight innings, striking out five and walking one, before turning the ball over to Rosario.
Benefiting from the Giants' three-run eighth that sent Pirates starter A.J. Burnett to the showers, Rosario closed out the club's first shutout since July 19 in the ninth despite allowing an inning-opening single to pinch-hitter Felix Pie.
The win was just the Giants' third in a seven-game homestand that began with two losses in three days against the Boston Red Sox.
Vogelsong clung to a 1-0 lead following a third-inning RBI single by Buster Posey until the reigning NL Most Valuable Player's second hit, another single, ignited a game-breaking, eighth-inning uprising.
After Hunter Pence's single put runners on first and third with one out against Burnett (6-9), Sandoval blasted a high fly that one-hopped the bricks at the 421-foot mark in right-center field, easily scoring Posey and Pence as the big third baseman rumbled into third with his first triple of the season.
Joaquin Arias' two-out double off reliever Tony Watson capped the scoring.
Burnett was charged with all four runs. He pitched 7 1/3 innings, giving up eight hits. He struck out six and walked three.
Despite the loss, the Pirates completed a winning Western swing, going 4-3 against the San Diego Padres and Giants. Pittsburgh won two of three in San Diego earlier in the week.
As it turned out, the Giants provided Vogelsong the only run he would need in the third inning, getting things rolling against Burnett with two out and nobody on.
Gregor Blanco worked a walk and Brandon Crawford followed with a hit-and-run single that sent his teammate to third.
Posey then hit a shot on the ground that barely eluded diving Pirates second baseman Neil Walker for his team-leading 65th RBI of the season.
The singles by Crawford and Posey were the only back-to-back hits by either team in the game until the single-triple combination by Pence and Sandoval in the eighth.
The Giants out-hit the Pirates 9-3.
NOTES: Sandoval has 15 triples in his career. ... The Giants' last set of consecutive home wins had come in the first two games after the All-Star break, July 19-20 against the NL West leader at the time, the Arizona Diamondbacks. ... Having split the four-game set in San Francisco, the Pirates are now 5-0-2 in their series of four or more games this season. ... The Pirates announced before the game that RHP Gerrit Cole would be pushed back two days in the rotation -- from Tuesday to Thursday -- in order to give him a full week's rest between starts. The move also sets up All-Star LHP Jeff Locke to pitch twice this week, including in Sunday's finale of a critical three-game series against the Cardinals.