SAN FRANCISCO -- Buster Posey had three hits, including an RBI single in a four-run first inning, as the San Francisco Giants snapped a three-game losing streak with a 6-3 victory over the Pittsburgh Pirates on Saturday night.
In beating Pittsburgh for the first time in three days, the Giants dropped the Pirates into a first-place tie with St. Louis atop the National League Central.
Tim Lincecum staggered through 5 1/3 innings, but managed to hold the Pirates to three runs. Six Giants relievers took it from there, shutting out the visitors on four hits, with Sergio Romo dealing a scoreless ninth for his 31st save.
Posey, who had just one hit in his previous 16 at-bats with runners in scoring position, delivered Marco Scutaro from third base with a broken-bat single to trigger the four-run first. The reigning NL Most Valuable Player later scored the inning's third run on Pablo Sandoval's infield out.
The Giants denied Pirates starter Francisco Liriano a second win on the team's weeklong trip to California, sending him to the showers after just four innings.
The Pirates nearly got Liriano (14-6) off the hook with one run in the fifth inning and two in the sixth, but the Giants tacked on single runs in those innings as well off Pittsburgh relievers Jared Hughes and Vin Mazzaro.
Wild pitches contributed to both of San Francisco's insurance runs. Hughes' wild pitch allowed Hector Sanchez to score in the fifth, and Hunter Pence advanced to second on a Mazzaro wild pitch in the sixth, eventually scoring on a single by Sandoval to put the Giants up 6-3.
Lincecum (7-13) gave up Tony Sanchez's first career home run in the Pittsburgh fifth, then got pulled after allowing a one-out double to Pedro Alvarez in the sixth, putting runners on second and third with the Pirates down 5-1.
Pinch-hitter Gaby Sanchez hit Jose Mijares one and only pitch into center field for an RBI single, and Tony Sanchez greeted Jean Machi the same way, smacking a first-pitch single to center that plated Alvarez and getting Pittsburgh within 5-3.
But the Pirates got only two more hit the rest of the way against the San Francisco bullpen and fell to 4-2 on their trip.
Lincecum, who entered the game tied for the NL lead in losses, gave up three runs on three hits in his 5 1-3 innings. He walked four and struck out eight.
Jose Tabata had three hits, including a ninth-inning double, for the Pirates, who were out-hit 11-7 in the game.
The Giants' big first inning was as much bad luck as bad pitching for Liriano.
After Marco Scutaro led off with a sharp single to center, Joaquin Arias sliced a double down the right-field line that Pirates right fielder Andrew Lambo thought landed foul. Umpire Lance Barksdale, who was farther from the landing than Lambo, insisted it had fallen on the line.
Set up with runners on second and third with no outs, the Giants' first three runs scored on Buster Posey's broken-bat single to left field, Brett Pill's check-swing roller down the third-base line and Pablo Sandoval's slow roller to second base.
Gregor Blanco capped the five-hit inning with a solid single to left, scoring Pill with the fourth run.
The four runs surpassed in one inning the Giants' 3.4-run per-game scoring average at home this season, the lowest mark in all of baseball. The Giants had scored fewer than four runs in four of the five previous games on their current homestand.
Liriano, who had allowed a total of one run and eight hits in his two previous starts, was pulled for a pinch hitter in the top of the fifth, having already thrown 102 pitches. He shut out the Giants after the four-run first, but surrendered nine hits and two walks, striking out three.
NOTES: The Giants hadn't scored four or more runs in an inning at home since a four-run sixth against the Oakland A's on May 30. ... Pirates starting pitchers had allowed only seven earned runs in the first five games of their Western trip, posting a 1.99 ERA over that stretch. ... Pirates C Tony Sanchez, who has caught each of Liriano's last five games, had only two RBIs in 38 at-bats before his fifth-inning homer. ... The home run was Pittsburgh's 16th in the last 13 games. ... After waiting five days for his bruised hand to show some improvement, the Pirates chose to place OF Starling Marte on the disabled list, retroactive to Monday. Marte has been unable to grip a bat strongly since hurting his hand last Sunday while sliding into third base. ... OF Andrew Lambo was recalled from Triple-A Indianapolis to take Marte's spot on the Pirates' active roster. Lambo, who has 32 minor-league home runs this season, went 1-for-9 in an earlier call-up by Pittsburgh.