October 11, 2020 | 2:33am

The Lakers were just seconds away from an NBA title, confetti machines at the ready courtside. Then Jimmy Butler and the Heat ripped that celebration away from them.

The pain was written on the Lakers’ faces as they trudged off the court in Disney World. Will they come back for Sunday’s Game 6 hungry, or hung over?

“It’s a tough loss. There’s no doubt about it. We were very close,” Lakers coach Frank Vogel said. “But our group’s fine. We’re going to bounce back strong. We’ll have a better performance in Game 6.”

“We’ve got to be better. We’ve just got to be better in Game 6 and close the series,” said LeBron James, who has been brilliant, only to find Butler his equal.

Friday marked the 10th time James had scored 40 points in a playoff game and still lost, second only to Michael Jordan’s 12. And James and Butler have put on a duel that Jordan would be proud of.

Butler has scored or assisted on 240 points in Games 2-5. That’s the highest total in four ganes in an NBA Finals other than James’ 245 three years ago. Jordan had 239 in a four-game stretch in 1993.

LeBron James looks to make a move on Jimmy Butler during the Lakers' Game 5 loss.
LeBron James looks to make a move on Jimmy Butler during the Lakers’ Game 5 loss.Getty Images

With defensive anchor Anthony Davis trying to play through a heel contusion, suddenly the pressure has shifted to the Lakers.

“To be that close to accomplishing our goals … we’ve got another one Sunday, and that one we have to go get,” said Davis, who aggravated his heel injury in the first quarter. “We still have to realize we’re up in the series, but we definitely use this as fuel.

“You come back, you look at the film, fix your mistakes and then come out in Game 6 remembering how close we were. If we don’t make our mistakes, we win the game. So you use it as fuel. But we’re still up in the series. … We have to keep that in mind. It’s a tough one because we know we had this one in the bag.”

How long will those mistakes haunt the Lakers? Davis, who is listed as probable for Game 6, gave them a 108-107 lead with 21.8 seconds left, but he got called for a foul five seconds later to hand Miami go-ahead free throws. A missed wide-open look from Danny Green and a turnover by Markieff Morris sealed the loss, and left the courtside confetti machines idle.

Butler said he was too focused to notice. With 35 points, 12 boards and 11 assists in 47 marathon minutes that left him doubled over, that’s believable.

“I don’t be paying attention to them over there. I don’t pay attention to the confetti machines,” Butler said. “I’ll be so locked-in on the game, on my squad, because we’re here to win.”

But don’t think the Heat haven’t heard the talk that they have no shot, and aren’t using it for motivation.

“We hear it. It’s hard not to. We just want to go embrace it,” Duncan Robinson said. “We’ve got a bunch of dogs in that locker room who love competing.”

With Goran Dragic still hurt and doubtful for Game 6, Robinson stepped up with 26 points Friday. Tyler Herro is second on the Heat to Butler in Finals scoring (16.2). They’ll likely need big games from both Sunday.

“Everybody counted us out since the beginning of the playoffs. We don’t really care what people have to say,” Herro said. “I’m sure there’s still people counting us out. We’re not going anywhere anytime soon. We have two more games to win.”