Yankees manager Aaron Boone takes the ball from Gerrit Cole...

Yankees manager Aaron Boone takes the ball from Gerrit Cole during the seventh inning against the Los Angeles Dodgers at Yankee Stadium on Friday. Credit: Jim McIsaac

Gerrit Cole talked Aaron Boone into facing one more batter.

It was one too many.

With Cole at a season-high 102 pitches and a runner on after a leadoff walk to Mookie Betts in the seventh inning, Max Muncy torpedoed the righthander’s 103rd pitch 416 feet into the second deck in rightfield for a two-run homer that gave the Dodgers the lead in a 2-1 victory over the Yankees in front of a sellout crowd of 46,450 at the Stadium.

“Figured he was going to give me a conversation,’’ Cole said of Boone. “He asked me to get Muncy and [I said], ‘Of course.’ ”

“Obviously, in hindsight, I probably should have grabbed him there,’’ Boone said. “He had pitched so well. I felt like he was competitive back in the Mookie at-bat and I felt like he had enough to get Max. Jumps out in front of him but then got a mistake. I’ve got [lefthander Brent] Headrick teed up there. That’s on me. I should probably get him there ... Sometimes you have to take it out of their hands.”

The loss to open the season’s second half snapped a four-game winning streak for the Yankees (54-43), who did pick up a half-game on the AL East-leading Rays, who were swept by the Red Sox in a doubleheader on Friday. The Yankees are 2 1⁄2 games back. The two-time defending champion Dodgers are an MLB-best 62-36.

Cole (3-5, 3.93 ERA) was brilliant until the seventh; considering the opponent, he had his best outing in 10 games since returning from Tommy John surgery on May 22.

The righthander was at 90 pitches and took a 1-0 lead into the seventh before walking Betts to start the inning. Boone could have brought in Headrick to face the lefthanded-hitting Muncy, and The decision backfired when Muncy hammered a 2-and-2, 90-mph slider halfway up the second deck in right for his 18th homer of the season.

Said Cole: “I looked at the pitch, it’s not where I want it [he wanted it below the strike zone], but I looked at the swing and it was pretty excellent. It stinks ... Just didn’t really give the pitch a chance and, like I said, he pulled out a great swing. So hats off to him.”

The Yankees’ offense, which thrived in three comeback victories in Washington against the Nationals’ historically awful bullpen, mounted little Friday night in amassing six hits.

The Yankees nearly tied it in the eighth when Trent Grisham walked with one out against Alex Vesia and Ben Rice roped one off the wall in right-center. Third-base coach Luis Rojas waved Grisham around and shortstop Betts threw him out at the plate on a bang-bang play.

Dodgers righthander Roki Sasaki allowed one run (unearned) and five hits in 5 2⁄3 innings in which he walked one and struck out five. Cole, who retired 10 straight before walking Betts, allowed two runs, four hits and one walk with eight strikeouts in six innings-plus.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME