Jacob deGrom did his best to flip the equation and turn Saturday into the shortest day of the season for the Mets.

Stress was kept to a minimum. That became especially true in the ninth inning at Marlins Park, when Lucas Duda’s two-run homer pushed the Mets beyond three runs for the first time in eight games, but deGrom previously made a two-run lead seem formidable.

DeGrom needed eight cracks for career victory No. 1, but can at least appreciate that he ended the drought with the best performance of his brief career.

“To have a performance like that and get the win feels really good,” the rookie deGrom said after pitching seven shutout innings in the Mets’ 4-0 victory over the Marlins.

DeGrom (1-4) allowed five hits with three walks and struck out seven before Jeurys Familia and Jenrry Mejia each pitched a scoreless inning to seal the Mets’ third victory in four games.

Over their last five games, Mets starting pitchers have posted a 1.27 ERA.

In his previous three starts this month deGrom struggled, allowing 13 earned runs on 26 hits over 15 innings. But he never provided the Marlins with an opening Saturday.

“I think it’s the fact he threw his off-speed stuff for strikes,” manager Terry Collins said. “They couldn’t just sit on one pitch, they had to look for other things, and he made some real good pitches with his slider that he hasn’t been making.”

In recent days, Collins has hinted deGrom and veteran Daisuke Matsuzaka could be battling for one spot in the rotation once Dillon Gee returns from the disabled list, perhaps in the next 10 days.

Matsuzaka gave a solid showing Friday, when he allowed one run over 5 ¹/₃ innings, but deGrom was even better. The Mets certainly appreciated the fact he survived through seven innings.

“[DeGrom] has the ability, want, desire to pitch deep into the game,” David Wright said. “It’s not enough for him to pitch five innings or make a quality start.”

Duda’s two-run blast in the ninth against Chris Hatcher gave the Mets (34-41) a cushion a day after the team twice had the potential tying run thrown out at the plate in the final two innings of a loss here.

New Rochelle native Tom Koehler (5-6) gave the Marlins a shot by allowing two earned runs over seven innings on four hits with eight strikeouts and three walks.

Wright finished 3-for-4 with an RBI to continue a hot road trip. He is 10-for-23 (.435) with two homers over his last five games after pulling a disappearing act for the previous three weeks that included a 2-for-39 (.051) freefall.