Updated

Flushing, NY (SportsNetwork.com) - Jacob deGrom continued his recent success on the mound to help the New York Mets even their four-game series with the San Francisco Giants with a 4-2 decision.

DeGrom (6-5) was locked in a battle with San Francisco's Jake Peavy throughout the evening, with both pitchers taking no-hitters into the seventh inning.

The Mets rookie logged a career-high 7 1/3 innings, allowing two runs on four hits and a walk while striking out seven to grab his fifth win in as many starts.

"I think we all have to start to understand that this kid is something special," said Mets manager Terry Collins. "Outstanding job tonight. He's an impressive kid."

Peavy (0-2), who retired the first 19 batters he faced, was the tough-luck loser after surrendering four runs on four hits over seven innings of work.

"There are a lot of positives," said Peavy of his outing. "But it's just hard to go on that right now with your team losing the game."

Making his second start with the Giants since being acquired from Boston, Peavy hasn't recorded a win since April 25 at Toronto. The right-hander has gone 0-11 with a 5.28 ERA since then, and his teams have lost 11 straight games he has taken the mound.

With two outs in the top of the seventh, Pablo Sandoval sliced a line drive that split the gap in left for an opposite-field double which broke up deGrom's no-hit bid. Michael Morse followed with a groundout, however, that kept the shutout intact.

Daniel Murphy ended Peavy's perfect game and no-hitter with a one-out double to left in the home half before David Wright muscled a single to left which put runners at the corners. Peavy plunked Lucas Duda to load the bases and Travis d'Arnaud sent a sacrifice fly to right that opened the scoring.

Juan Lagares then ripped a single through the hole in the left side that plated Wright for a 2-0 edge before Wilmer Flores cracked a two-run double into the left-field corner.

"That was a real big hit by (Flores)," said Collins. "It turned out to be a big run."

It was a big hit because the Giants answered with two runs in the eighth. Brandon Belt singled to lead things off and Juan Perez doubled to right center two batters later. Travis Ishikawa then pinch-hit for Peavy and sent a single up the middle that cut the deficit in half.

Jeurys Familia came on in relief of deGrom, struck out Hunter Pence and got Brandon Crawford to end the inning with a flyout to center.

Jenrry Mejia tossed a scoreless ninth to pick up his 16th save of the season.

Defense was key for each pitcher early on.

With two outs in the second, Belt reached and poked a fly ball to left center, where Lagares made a leaping catch at the edge of the warning track while barreling into the wall to end the inning.

DeGrom appeared to be the game's first baserunner with a one-out, infield single in the third. However, San Francisco challenged the ruling and it was overturned as Crawford's barehand throw just beat deGrom to the bag.

In the fifth, Sandoval slapped a fly down the left-field line, but Eric Young Jr. made a sliding catch just inside fair territory to keep deGrom's perfect game try alive.

Belt was the first baserunner of the night for either team, as he drew a two- out walk later in the fifth. DeGrom didn't allow the base on balls to hurt him, though, inducing a soft groundout by Joe Panik to keep the Giants hitless through five.

Game Notes

Peavy has taken a no-hitter through 6 1/3 innings four times in his career. He has never gone any further than that ... Belt was activated from the disabled list prior to the game after missing 12 straight games with a concussion ... New York went 3-for-4 with runners in scoring position, while San Francisco went 1-for-3 in those instances ... A fan fell over a railing in the outfield at Citi Field during batting practice prior to the game. Further reports revealed the unidentified male fell from the Party Deck section in left field onto the playing surface while trying to grab a ball hit during San Francisco's batting session. He was immobilized on a stretcher while conscious and transported for treatment.