Giancarlo Stanton of the Yankees connects for a long seventh-inning...

Giancarlo Stanton of the Yankees connects for a long seventh-inning home run against the Toronto Blue Jays at Yankee Stadium on Friday, Aug. 17, 2018.   Credit: Jim McIsaac

For the first time in three starts with the Yankees, Lance Lynn didn’t have it.

Fortunately for him, an offense that had been swinging dead wood the previous two games found some pop and took Lynn off the hook Friday night at the Stadium in a rain-shortened 7-5 victory.

“The offense came back and bailed me out,” said Lynn, who allowed four runs before the Yankees ever came to the plate.

The Yankees led 7-5 when rain halted play at 9:41 p.m. with one out in the bottom of the seventh, just after Giancarlo Stanton hit his 31st homer, a bomb to right-center. After a delay of 1 hour, 25 minutes, and with rain in the forecast for at least another couple of hours, the game was called.

The Yankees (76-46) stayed 10 ½ games behind the AL East-leading Red Sox. They remained three games ahead of the A’s — who beat  the Astros in 10 innings on Friday night after tying the score in the ninth — in the battle for the first wild card.

Trailing 4-2 entering the fourth against former Patchogue-Medford star Marcus Stroman, who almost never pitches well at the Stadium, the Yankees took the lead on a three-run homer by Neil Walker.

“Walk came up huge for us,” said Stanton, who went 2-for-4 and has a .289/.351/.663 slash line with eight homers, seven doubles, 17 RBIs and 18 runs in 21 games since Aaron Judge went to the disabled list July 27.

After the Blue Jays (55-67) tied it in the top of the fifth, the Yankees took a 6-5 lead in the bottom half when Gleyber Torres beat out a potential inning-ending double-play ball.

But just as significant to all involved were the two runs the Yankees scored in the bottom of the first after being put in the 4-0 hole. Didi Gregorius had a two-out RBI triple and scored on a double by Miguel Andujar.

“It was a great answer,” Aaron Boone said. “I thought our at-bats all night, up and down, were really, really strong. We made Stroman work really hard. Tonight we were able to get a couple of those big hits to throw some crooked numbers up there.”

Lynn, who came in 1-0 with a 0.54 ERA in three appearances with the Yankees (two starts), allowed five runs and six hits in four innings. But Chad Green was terrific in relief, throwing two scoreless innings, and David Robertson struck out two in a perfect seventh.

Stroman, 2-5 with a 5.84 ERA in eight previous starts at the Stadium, allowed five runs and six hits in four innings. Friday made it seven straight Stadium starts in which he failed to complete six innings.

The night did not have a promising start for the Yankees as the Blue Jays sent nine to the plate in a 37-pitch inning by Lynn.

Lynn walked two of the first three batters he faced. The fourth, Kendrys Morales, inside-outed a 1-and-1 fastball down the leftfield line for an RBI single that made it 1-0. Leftfielder Brett Gardner threw to second, where Justin Smoak made a too-wide turn, but Torres dropped the ball as he tagged Smoak.

Lynn struck out Russell Martin for the second out, but Kevin Pillar flared one to right that landed in front of a sliding Walker for an RBI single that made it 2-0. Lynn walked Randal Grichuk to load the bases and Aledmys Diaz smacked a fastball back up the middle for a two-run single that made it 4-0.

“It just wasn’t good,” Lynn said of his outing, refusing to use the wet conditions as an alibi. “I have to be better next time. I’m going to be better.”

After Aaron Hicks walked with two outs in the first, centerfielder Pillar took a bad angle on Gregorius’ liner to left-center, turning a single into an RBI triple as the ball rolled to the wall. Andujar then doubled to right to make it 4-2 and give him 56 extra-base hits, most among MLB rookies. Andujar has 10 extra-base hits in his last 11 games.

“Not an ideal start to [have to] come from behind,” Stanton said. “But to fight back and get the win is really huge for us.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME