Matt Holliday #17 of the New York Yankees celebrates his...

Matt Holliday #17 of the New York Yankees celebrates his tenth inning three run home run against the Baltimore Orioles at Yankee Stadium on Friday, Apr. 28, 2017 in the Bronx Borough of New York City. Credit: Jim McIsaac

They all had different versions of when they first thought it was possible. Joe Girardi thought it was when Aaron Judge smashed his second home run, a ball hit so hard that it broke records. Matt Holliday thought it was when Jacoby Ellsbury hit the first grand slam of his career. Judge said he never doubted for a second; Holliday’s walk-off three-run homer in the 10th only proved to him what he knew to be true.

It seemed impossible, but at the same time inevitable. The Yankees, who were down by eight runs entering the bottom of the sixth inning, faced what seemed to be an insurmountable deficit against the team with the best record in the American League. But then again, these are the Yankees, who seem very intent on proving that this team — the one that no one thought was quite good enough when the season began — very much appears to be the real thing.

In their most dramatic display this season, the Yankees hit five home runs and beat the Orioles, 14-11, on Friday night at the Stadium on Holliday’s game-ending home run, a first-pitch drive that landed in the centerfield side of the Yankees’ bullpen. On the top step since the ninth — when they scored three runs, including a tying two-run homer by Starlin Castro — the Yankees enveloped Holliday in a mob at home plate, bringing the Gatorade cooler with them and giving him a soaking.

“It’s hard to describe,” Girardi said. “It’s an amazing feeling. We’re down 9-1 and then we were down 11-4 and our guys just — you know, this group is resilient, they never quit. We have the ability to hit the ball out of the ballpark, and that’s what we did.”

Down 11-4, they scored four runs in the seventh, courtesy of Ellsbury’s grand slam off former Yankees lefthander Vidal Nuño. They still trailed by three entering the ninth, but Chase Headley walked against Brad Brach and Holliday hit a long single to center to put runners at the corners with none out. Ellsbury’s forceout made it 11-9 and set the stage for Castro, who swung so hard that he went down to one knee and hit a no-doubter into the leftfield bleachers.

And of course Judge rocketed two home runs, giving him nine. He hit a solo shot into the Orioles’ bullpen in the fifth to get the Yankees within 5-1 and a two-run homer into Monument Park in the sixth to get them within 9-4. That second one left the bat at 119.38 mph, the hardest-hit ball in the Statcast era, according to the tracking technology’s Twitter account. “He’s the best hitter I’ve seen,” Holliday said.

Added Girardi: “I thought Judge’s second home run kind of gave us a feeling, like ‘Here we go.’ . . . It just kind of triggered something.”

The Yankees proved to be stubbornly resilient, even in the face of some admittedly crushing mini-defeats. The Orioles scored two each in the third and fourth to take a 4-0 lead, but the biggest — literally biggest — blast came in the fifth.

It was a windmill swing and a high fly ball that had CC Sabathia looking skyward, as if he couldn’t tell the difference between the projectile coming off Manny Machado’s bat and the moon. The people standing on the terrace in centerfield didn’t even move. Home runs don’t end up around there, generally.

Machado’s homer was measured at 466 feet, according to ESPN — the longest homer in MLB this season and the longest ever at the new Yankee Stadium — and was part of a seemingly relentless Orioles onslaught. They hit their 27th, 28th, and 29th home runs. But the Yankees now have hit 32, and the teams are tied atop the AL East at 14-7.

Mark Trumbo’s grand slam in the sixth against Bryan Mitchell gave the Orioles a 9-1 lead (two of those four runs were charged to Sabathia). Sabathia, who had begun the season as a rejuvenated and retooled version of himself, instead struggled. He was charged with seven runs and allowed nine hits in 5 2⁄3 innings, with two walks and six strikeouts. His ERA, which was 1.47 two starts ago, now is 4.34.

Machado drove in two runs in the third with a double to center (he was a triple short of the cycle) and Welington Castillo added a two-run homer in the fourth.

Five pitches into the fifth, Machado made it 5-0. But none of it mattered all that much in the end, because impossibly, inevitably, the Yankees willed it to be so.

“We’re a team that fights and battles,” Judge said. “The whole game I felt we were in it, to be honest.”

More Yankees headlines

Newsday LogoCovering LI news as it happensDigital AccessOnly 25¢for 5 months