With Aaron Boone blistering an overmatched umpire’s ears in the first of two games on Thursday against the Rays at Yankee Stadium, the Yankees won.

With the manager relaxed and looking like he was hanging out at Newport Beach in California, the Yankees copped the nightcap.

So, the Yankees proved they can win with Boone turning into Billy Martin or showing the calmness that made Joe Torre a Hall of Famer.

The biggest thing to come out of a very long day — in which the first game was delayed for almost 1 ¹/₂ hours because of expected rain that never arrived — was that the Yankees won, 6-2 and 5-1 in front 40,504 to push their AL East lead over the Rays to eight games.

How much Boone scalding Triple-A umpire Brennan Miller with profanity played a part in the sweep is questionable because there were a bevy of players who had a hand in the Yankees taking three of four from their closest competitor.

Boone referred to his batting lineup as “f—ing savages in that f—ing box” during the expletive-laden tirade.

“It has an impact when terrible pitches are called strikes,’’ said Brett Gardner, who took his bat to the ceiling of the Yankees’ dugout when called out on strikes in the second inning of the first game which led to Boone, fearing his players and coaches were on the cusp of getting ejected for chirping at Miller, going nuclear and getting tossed for the third time this season.

Boone missed the last seven innings of the first game in which Domingo German gave up back-to-back homers in the first inning to Austin Meadows and Yandy Diaz, but no more in the next five frames and improved to 12-2. Boone was on hand to see Gio Urshela’s two-run homer in the second but missed a three-run fifth inning to which Urshela contributed an RBI double. And he wasn’t around to witness Tommy Kahnle, Zack Britton and David Hale provide three scoreless relief innings.

In the nightcap, Boone watched Chad Green load the bases without an out in the first and not allow a run. Nestor Cortes Jr. and Luis Cessa combined for 6 ²/₃ innings of one-run relief while Luke Voit hit a homer and a four-run sixth inning against Charlie Morton was highlighted by

Didi Gregorius’ two-run single. The Yankees are 8-0 when Green “starts’’ a game.

“It’s huge, now up eight games,’’ Voit said of the Yankees’ largest lead since they led by 8 ½ lengths on July 5. “And do it against a Cy Young candidate right now.’’

Morton (11-3) held the Yankees to one run and five hits on July 7 in St. Petersburg, Fla. when his baffling curveball danced indoors. He cruised through the first five frames in the second game Thursday night, allowing just Voit’s 18th homer. Then he issued three walks and two scored.

“Got to make it bigger,’’ Aaron Judge said of the eight-game bulge over the Rays, against whom the Yankees are 12-5 this season and have only two games (in St. Petersburg) remaining with them. “You never know with the trade deadline [July 31] who they acquire.’’

The Rays might want to see about a bat that can produce in the clutch after going 0-for-11 in the two games with runners in scoring position.

The Rays were 1-for-24 with RISP in the four games, three of them Tampa Bay losses.

“These are big wins with the team on your heels. It counts as kind of double. We are trying to win the division and to win three of four and sweep a doubleheader against a very good club [is big],’’ Boone said.

Crew Chief Gerry Davis said Boone, who will be fined, went too far with the profanity.

Again, what effect Boone’s belittling an umpire not good enough to work a big-league game had on the Yankees winning two isn’t measurable. But as long as his players believe it had an impact, nobody is going to try and talk Boone out of it if he chooses to blister another umpire’s ears.