Knicks coach Tom Thibodeau and guard Jalen Brunson break down what went wrong in their Game 5 overtime loss to the 76ers on Tuesday at Madison Square Garden. Credit: Newsday/William Perlman

The Knicks had played in fits and starts all night, but still found themselves right where they wanted to be — maybe longer than they wanted it to be, but still in their comfort zone.

At Madison Square Garden. The game in the balance. Needing just one more time to show that they were the team that would not tire, would not fold and after a season of silencing doubters, rise one more time.

All series long it had been the fourth quarter, but after a frantic finish to regulation, it would be overtime, five more minutes to show that they were what they have been all season — the more resilient, the tougher and more strong-willed team.

But this time, they were not. They could not complete the task and couldn’t close out the series, sending it back to Philadelphia for Game 6 Thursday night. While the Knicks fought with Jalen Brunson delivering huge shots, it was the 76ers who had one more answer every time with Tyrese Maxey carrying them to a 112-106 win to keep the series going with the Knicks holding a 3-2 advantage.

Maxey scored 46 points on 17-for-30 shooting from the field.

In the last 25 seconds of regulation, Maxey was able to knock down two three-pointers and a free throw to tie the score at 97 and send the game into overtime.

The 76ers didn’t fade this time, even with the Knicks keeping Joel Embiid under wraps, allowing him to score just 19 points on 7-for-19 shooting in 48 minutes. Maxey was the one to deliver, however, as he kept hitting tough shots and a fast-break layup by Kelly Oubre Jr. gave Philadelphia a 103-102 lead. Embiid then hit a second-chance jumper, drawing a foul and converting a three-point play for a four-point lead with 1:40 remaining.

The Knicks had three players — Brunson, Josh Hart and OG Anunoby — play more than 50 minutes, but they still could not manage to put the finishing touches on the 76ers.

The fight may have continued to overtime, but the Knicks saw the game escape their grasp in the final 28 seconds of regulation when a six-point lead disappeared with a series of miscues and second guesses.

Maxey provided the heroics for the 76ers, draining a tough three-pointer as he was fouled by Mitchell Robinson and completing a four-point play to cut the Knicks’ lead to two.

Hart went to the line with 15.3 seconds left and after missing the first free throw, bounced in the second. But Maxey struck again, hitting a 34-foot three-point field goal to tie the score with 8.5 seconds remaining.

Brunson had the ball in his hands, but as he tried to launch a baseline runner this time Nic Batum got a piece of it, sending the game to overtime.

“Yeah, that’s what [Maxey] does,” said Brunson, who led the Knicks with 40 points. “And so, you got to pick your poison, either him or Joel. He was able to make some big-time shots. Obviously, you want to make it a little bit more difficult for him, but he made some tough shots, as well. So we got to come back and just play a little tougher, play a little better and we need to stick together.”

But the Knicks also saw their own mistakes come back to haunt them. Robinson took the blame for the four-point play, unable to set his feet as he rushed to defend Maxey and fouling. Hart blamed himself for missing a free throw that could have pushed the lead safely back to four. And the Knicks miscommunicated the plan to foul before allowing a three-point attempt by Maxey to tie the score.

“What you have to do is, they’re out of timeouts, so they’re going quick,” Tom Thibodeau said. “But you also have to read what’s happening. Is he making both? That puts you up four? Is he making one? That puts you in a different situation. If he misses both that puts you in a different situation. So you’re communicating that to your players but you’re also, you’ve got to make sure that that’s being communicated to people on the line, too.

“ That’s where our communication has to be better. If you miss two and you say foul, everyone’s got to be aware and alert to what’s going on.”

“We didn’t relay that,” Hart said. “And I think that’s an error on the guys on the court. We got to make sure we know what the situation is. But we can’t do anything about it now. Got to regroup, watch film and see what we could have done better. And get ready for the game.”

There was one more flagrant foul on Embiid, who entered the night already the target of the Garden crowd, to spark the final march. Brunson drove to the rim with the Knicks trailing by four with 1:22 remaining in overtime and Embiid raked down across Brunson’s face, a flagrant 1 that sent Brunson to the line for two free throws — he converted one — and gave the Knicks the ball. This time Brunson didn’t miss, draining a three to tie the score with 1:10 left.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME