Pablo Sandoval drove in three runs and got three hits, including an RBI double with two outs in the ninth inning that sent the San Francisco Giants over the New York Mets 4-3 Monday.
The Giants took three of four at Citi Field. The Mets lost a home series for the first time since June 10-12 against Milwaukee.
Sandoval hit a two-run double in the third, then delivered again in the ninth.
Gregor Blanco singled with two outs off Jenrry Mejia (5-4) and stole second, and Buster Posey drew his fourth walk of the game. Sandoval followed by slicing a ground-rule double into the seats down the left-field line.
Mejia, the Mets' sixth pitcher of the afternoon, had allowed just one earned run since June 18.
Sergio Romo (5-3) got the win with one scoreless inning and Santiago Casilla pitched a perfect ninth for his ninth save.
The Giants scored the tying run in the seventh off Jeurys Familia, who had gone 13 straight relief appearances since June 30 without permitting an earned run.
Hunter Pence led off with a long drive that glanced off the glove of leaping left fielder Chris Young as center fielder Juan Lagares also jumped for the ball at the wall.
After Blanco walked, Familia threw a wild pitch that made it 3-all. Sandoval singled, and Lagares threw out Blanco at the plate.
Mets manager Terry Collins was ejected at the end of the seventh by plate umpire Ben May for arguing balls and strikes.
Daniel Murphy hit a two-run homer in the first. He singled in the fifth off Tim Hudson, stole second and later scored on David Wright's infield single.