Updated

Pablo Sandoval drove in a pair of runs as the San Francisco Giants took a 6-3 win over the Pittsburgh Pirates in the third contest of a four-game set.

Buster Posey went 3-for-5 with an RBI and a run scored, while Brett Pill and Gregor Blanco each drove in a run for the Giants, who had dropped five of six coming into the game.

Tim Lincecum (7-13) gave up three runs on three hits with four walks and eight strikeouts over 5 1/3 innings to pick up the win.

Tony Sanchez hit a solo home run and drove in two, while Gaby Sanchez had the other RBI for the Pirates, who dropped into a tie with St. Louis for the top spot in the NL Central as the Cardinals defeated the Braves on Saturday.

Francisco Liriano (14-6) gave up four runs on nine hits with a pair of walks and three strikeouts in just four innings of work. He had won five of his previous six starts coming in.

"Inconsistent command. At the end of the day, that's what it was," Pirates manager Clint Hurdle said about Liriano.

San Fran jumped all over Liriano in the first inning as the first three batters had hits with Posey getting the scoring started on an RBI single. Pill later singled home a run and Sandoval followed with a groundout that plated another. Blanco made it a 4-0 game with a base hit to left.

"We haven't done that in a while, especially here at home, get some early runs," said Giants manager Bruce Bochy.

The score stayed that will until the fifth when Tony Sanchez led off the frame with his first career home run, but the Giants got it back in the home half as Hector Sanchez scored on a wild pitch by Jared Hughes.

In the sixth, Gaby Sanchez and Tony Sanchez each hit an RBI single to make it a 5-3 contest, but Pablo Sandoval's RBI single in the home portion gave the Giants a three-run lead.

Javier Lopez struck out Pedro Alvarez to leave men stranded at the corners in the seventh, Santiago Casilla pitched a 1-2-3 eighth and Sergio Romo stranded a man on second in the ninth for his 31st save of the season.

Game Notes

Before the game, the Pirates placed outfielder Starling Marte on the 15-day disabled list and recalled outfielder Andrew Lambo from Triple-A Indianapolis ... Liriano is the first Pirate since Vernon Law in 1965 to record a decision in each of his first 19 starts of a season. The last Pirate to have a decision in more than his first 19 starts of a season was Nick Strincevich (21) in 1946 ... Pittsburgh has won four of the six games against San Francisco this season ... The Pirates were just 2-for-12 with runners in scoring position and left eight men on base.