PITTSBURGH (AP) - Brandon Belt started San Francisco's comeback with an RBI single in a three-run seventh inning, then added a two-run homer in the eighth as the Giants beat the Pittsburgh Pirates 5-3 Sunday for their season-high sixth straight win.

Jordy Mercer's two-run homer in the third off Jeff Samardzija (4-9) put the Pirates ahead.

Trevor Williams took a two-hit shutout into the seventh, when Hunter Pence walked leading off and Buster Posey doubled. Belt and Brandon Crawford hit consecutive run-scoring singles off left-hander Tony Watson (4-2), and Kelby Tomlinson's sacrifice fly gave San Francisco a 3-2 lead.

Belt homered in the eighth off Edgar Santana, his 16th this season.