The Giants had lost three in a row and Pittsburgh had won three straight.
Posey broke out of a 0-for-13 stretch with his second four-hit game in less than two weeks. All four hits came in the first four innings as the Giants built a 10-2 lead.
Posey and Alen Hanson each drove in three runs. McCutchen hit a leadoff homer and later drew four walks for a San Francisco that batted .212 and averaged 2.7 runs over its previous six games.
Francisco Cervelli drove in five runs with three hits for the Pirates. His 11th home run of the season and fourth career grand slam, off reliever Pierce Johnson, closed Pittsburgh within 11-7 in the seventh inning.
Adeiny Hechavarria, playing his second game since being traded from Tampa Bay to Pittsburgh, went 2 for 2 with a home run.
Giants starter Derek Holland (6-8) gave up five runs in 6 1/3 innings.
Clay Holmes (1-2) was tagged for seven runs in 2 2/3 innings in his third career start.
Pirates OF Gregory Polanco struck out as a pinch-hitter. Manager Clint Hurdle said Polanco will get another rest day in Sunday's series finale.
Giants: 1B Brandon Belt (hyperextended right knee) will start a rehab assignment with Triple-A Sacramento on Saturday, manager Bruce Bochy said. If all goes well, Belt could join the team for next week's series against the Dodgers in Los Angeles, which starts Monday. . RHP Johnny Cueto, who underwent Tommy John surgery earlier this month, was moved to the 60-day DL. RHP Casey Kelly was selected to the Giants' Major League roster in a corresponding move before Friday's game. . RHP Derek Law was optioned to Triple-A Sacramento.
RHP Trevor Williams (9-8, 3.88 ERA) will pitch Saturday for the Pirates. He has a 2.25 ERA without a decision in two career starts against the Giants. The Giants hadn't announced a starter for Saturday's game by Friday afternoon.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/AP-Sports