SAN FRANCISCO — Garrett Jones and Jordy Mercer homered, Jose Tabata hit a three-run double, and the NL Central-leading Pittsburgh Pirates beat the San Francisco Giants 10-5 on Thursday night.

Pedro Alvarez hit a go-ahead, two-run double to start a seven-run fifth and matched his career high for RBIs in a season with 85. Russell Martin and Gaby Sanchez added sacrifice flies and Tabata had a three-run double in his second plate appearance of the inning.

Marco Scutaro had a tying two-run single in the fourth for San Francisco after scoring in the third on Buster Posey's sacrifice fly.

Giants right-hander Matt Cain left in the fourth inning after getting hit on his pitching arm on a line drive by Sanchez. He sustained a contusion on his forearm and X-rays were negative.