No no-no, but no matter, as Montgomery and the Yankees went on to a 4-2 victory before 44,268 on Tuesday.

Montgomery said he wasn’t annoyed that he lost the no-hitter. But he was annoyed.

“I gave it up to the lefty,” he said. “That can’t happen. But happy with (the outing).”

Montgomery (7-5) allowed one run and two hits in 6 2/3 innings, with one walk and six strikeouts. The Yankees overcame a shaky appearance by Dellin Betances to begin a nine-game homestand on a 69-degree night with their fourth win in five games.

The Yankees scored their first run in an unusual way: on a triple play. They loaded the bases in the second against Luis Castillo on consecutive singles by Matt Holliday, Didi Gregorius and Chase Headley. That brought up recent trade acquisition Todd Frazier for his first Yankee Stadium at-bat. The many Frazier fanatics on hand from Toms River, New Jersey, were hoping for something memorable. They got it.

Frazier hit a short-hop liner to shortstop Jose Peraza. Gregorius, thinking the ball might be caught on the fly, headed back to second before starting for third base. Peraza stepped on second to start what looked like a routine double play with the run scoring and Gregorius taking third.

Only Gregorius, after his late start, started to jog to third. First baseman Joey Votto noticed and fired to third. On the ensuing rundown, Gregorius was called out for running out of the basepath.

Said Gregorius: “It’s a line drive. So you’ve got to go back to the bag. And then it bounced. So I was kind of like in between.”

The result: a run-producing 6-6-3-3-5-6 triple play. No RBI for Frazier, but a memory nonetheless.

Yankees videos

“That’s got to be a record,” Frazier said. “It’s funny to laugh about it now, but at the time I was a little upset.”

The Yankees’ other runs against Castillo (1-4) were more conventional. In the fourth, Aaron Judge singled, moved to second on a grounder to short, was balked to third and scored on Gregorius’ sacrifice fly to right. The Yankees made it 3-0 in the fifth on Austin Romine’s RBI double.

Montgomery departed after 85 pitches to a long ovation after allowing a two-out single to Adam Duvall in the seventh.

Eighty-five pitches?

“It’s fine,” Montgomery said. “We’ve got too many good arms in the bullpen to waste. I was OK with it.”

Tommy Kahnle got the last out of the seventh. Betances walked two and got two outs in the eighth before allowing an RBI double to Billy Hamilton to deep right. It went off the heel of Judge’s glove to make it 3-2 and put runners on second and third. The 6-7 Judge caught up to the drive but was actually too tall — he reached up and had it hit off the bottom of his glove before crashing face-first into the wall. Judge was not hurt.

The Yankees were fortunate that the tying run didn’t score on the play. Zach Cozart, who has a quadriceps injury, favored his sore right leg as he hobbled from first to third. Reds manager Bryan Price replaced Cozart with a pinch runner after the double. Girardi brought in Adam Warren, who struck out Eugenio Suarez to maintain the lead.

“Warren did an awesome job,” Betances said.

Gregorius made it 4-2 in the eighth with his 15th home run, a two-out drive into the Yankees’ bullpen in right-center.

Aroldis Chapman, who got a vote of confidence from Girardi before the game, pitched a 1-2-3 the ninth against his former club for his 12th save.

Subscribe to Newsday’s sports newsletter

Receive stories, photos and videos about your favorite New York teams plus national sports news and events.