SAN FRANCISCO -- A broken bat, a dribbler and a grounder to second.
The San Francisco Giants have had many such innings this season, one in which they rank dead-last in all of baseball in runs scored at home.
But nobody was complaining when it happened again Saturday night.
Buster Posey had three hits, including an RBI single on a broken-bat flare in a four-run first inning, as the Giants snapped a three-game losing streak with a 6-3 victory over the Pittsburgh Pirates.
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.
In a marquee pitchers' duel between a two-time Cy Young Award winner and a 2013 hopeful, luck spelled the difference. Tim Lincecum's Giants had it; Francisco Liriano did not.
"Just goes to show you," Pirates manager Clint Hurdle observed afterward. "It's not how hard you hit it, it's where."
After Marco Scutaro led off the pivotal first against Liriano (14-6) 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 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.
"Just one of those innings," Hurdle lamented.
Gregor Blanco capped the five-hit inning with a solid single to left, scoring Pill with the fourth run.
"We just strung together some good at-bats, some long at-bats," Giants manager Bruce Bochy said.
Posey credited Scutaro and Arias.
"It's Scoots getting on and then Arias," he said. "Second and third right out of the chute. That set the table for us."
The four runs surpassed in one inning the Giants' 3.4-run per-game scoring average at home this season. The Giants had scored fewer than four runs in four of the five previous games on their current homestand, and hadn't had a four-run inning at home since May 30.
"It made a big difference in the game," Lincecum (7-13) said of the head start. "It gave me a lift."
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.
"It was a street fight," Hurdle said of Liriano's second-shortest effort of the season. "He gave us everything he had for four innings."
Lincecum had a similar night, but with a four-run cushion. He staggered through 5 1/3 innings but managed to hold the Pirates to three runs and three hits. He walked four and struck out eight.
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.
"They did what they had to do," Lincecum said.
The Pirates nearly got Liriano 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 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.
Jose Tabata had three hits, including a ninth-inning double, for the Pirates, who were outhit 11-7.
NOTES: The last-place Giants have won 13 of their last 16 games in which they scored four runs or more. ... Posey had gotten just one hit in his previous 16 at-bats with runners in scoring position before his first-inning RBI single. ... 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. ... 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 OF Starling Marte's bruised hand to show some improvement, the Pirates chose to place him on the disabled list, retroactive to Monday. OF Andrew Lambo was recalled from Triple-A Indianapolis to take Marte's spot on the Pirates' active roster.