Jacob deGrom is notorious for being able to give his team a chance to win even when he doesn’t have his best stuff. Last night was an example of that sort of game but, unfortunately, the Mets could not scrape out a win.

The righty pitched into the eighth inning and left with two runners on base, one of which scored. In 7.1 innings, deGrom ended up allowing five earned runs on nine hits and two walks, striking out four. He threw 100 pitches on the day, 66 for strikes.

“It’s frustrating. You make decent pitches and they get hits on them,” deGrom said. “They just did a good job and beat me.”

Having never allowed more than 16 home runs in a season, deGrom allowed home run numbers 22 and 23 last night. Jacoby Ellsbury hit a line-drive “Yankee Stadium” home run into the second row of the right field seats in the fourth, while Gary Sanchez hit a no-doubter solo shot to left field in the 6th.

Last night’s start makes deGrom 13-6 on the season. In 158.2 innings he’s struck out 183 (second in the NL) and walked 48 with a 3.35 ERA, 3.66 FIP and 1.160 WHIP.

“He pitches,’’ manager Terry Collins said. “He keeps you in the game. He just battles.’’