Updated

Angel Pagan drove in three runs and fell a double short of the cycle as the San Francisco Giants defeated the New York Mets, 8-5, on Tuesday at Citi Field.

Pagan scored the tying run in the fifth, then sent the Giants in front for good and on their way to a fourth straight win by beginning the seventh with a solo homer off Sean Henn (0-1).

"He's done such a nice job since he's come back," Giants manager Bruce Bochy said about Pagan. "I think we've seen the difference he makes on our club."

The Giants took advantage of a career-high six walks from New York starter Zack Wheeler, plating three of their runs in the second inning. Gregor Blanco, Buster Posey, Tony Abreu and Hunter Pence each drove in a run on the night.

New York had the bases loaded with one out in the ninth, but produced only one run on Daniel Murphy's RBI single. Sergio Romo induced Lucas Duda and pinch- hitter Andrew Brown into pop ups to end the game.

Pagan's homer allowed starter Yusmeiro Petit (4-0) to pick up the win. He allowed four runs on seven hits and three walks over six frames.

New York trailed, 3-1, entering the home fourth before taking the lead. Petit issued walks to Murphy and Duda, and Murphy came in to score on Wilmer Flores' line drive double off the wall in left.

Matt den Dekker then ripped a base hit up the middle to tie the game, but the Giants caught him in a run down between first and second. However, den Dekker was able to keep from getting tagged long enough for Flores to come in to score from third, which gave the Mets a 4-3 lead.

Wheeler was unable to hold the lead, though. Pagan walked to start the fifth and later came around on Posey's ground out to tie the game at 4-4.

The Giants took the lead in the seventh, and Abreu contributed an RBI double an inning later. Pagan then drove him in with a triple into center field that made it 7-4 Giants and Pence added an RBI single in the ninth.

Wheeler had no control early, issuing walks to five of the first nine batters he faced. His free pass to Petit in the second forced in the Giants' first run, and Pagan followed with a base hit into right to make it 2-0.

"He couldn't find the zone, fell behind (hitters) and wound up falling behind because of it," said Mets manager Terry Collins about Wheeler's command.

A Blanco grounder toward second gave the Mets a chance for a double play, but it wasn't turned quick enough and Abreu crossed the plate to give the Giants a three-run cushion.

The Mets got their first run in the home third. Ruben Tejada led off the frame with a double, Wheeler bunted him over and Eric Young's ground out forced Tejada home to make it 3-1.

Game Notes

Wheeler was tagged for four runs, allowing three hits over five innings of work ... Prior to the game, Mets pitcher Matt Harvey decided he will hold off on surgery on his right elbow, instead optioning for a rehabilitation process... Mets catcher Travis d'Arnaud left in the fourth after taking a foul ball off his shoulder the inning prior ... The Giants ended a five-game losing streak to the Mets ... The Giants have won all five of Petit's starts.