You were thinking it. We all were thinking it. Even THEY were thinking it.

The Knicks were rolling most of this Thanksgiving Eve in Boston against a struggling Celtics team. But because of so many fourth-quarter meltdowns that turned leads into losses for David Fizdale‘s young Knicks team, it just felt inevitable that heartbreak was only seconds away.

“Thank goodness,” Fizdale said with a laugh, “that clock ran out.”

And thank goodness Trey Burke decided to stop trying to please everyone by trying to run an offense and instead went back to being the guy who can carry an offense. Burke scored nine of his 29 points in the fourth quarter, including five in the final minute, to finally stop a six-game losing streak.

Alan Hahn, Bill Pidto and Wally Szczerbiak break down the Knicks victory over the Celtics, ending their 6 game losing streak.

“He willed this team to this win,” Tim Hardaway Jr. said.

The Celtics had cut what was a 21-point lead in the final quarter to just three points (112-109) with 34 seconds to go. On the ensuing possession, Burke waved off a screen from Enes Kanter and opted to take on 6-foot-8 Jayson Tatum and his 6-foot-11 wingspan at the top of the key in the ultimate game of one-on-one.

Burke dribbled right at Tatum, got him on his heels and pulled up for a game-clinching three-pointer with 12.9 seconds left. Burke had made a 20-footer off the glass from the left side with 50.2 seconds left to put the Knicks up by six.

The Knicks hit a season-high in three-pointers (15) and avoided another late meltdown with some great effort plays, but when it comes to keys to the victory, Fizdale said the list was short.

“There was one key,” he said, “it was Trey.”

David Fizdale holds his post-game press conference after the Knicks' 117-109 win over the Celtics

That’s four straight games that Burke has provided a huge offensive lift off the bench since he declared it was time for him to go back to being the player he is, rather than try to be the player he thought he should be. Burke is averaging 25.8 points per game and 4.3 assists in 28.1 minutes per game over the last four games and is shooting 58.8% from the field and 45% from three-point range.

And remember, the last time the Knicks played the Celtics, on Oct. 20, Burke had a chance to force overtime when he was fouled on a three-point attempt in the closing seconds. But he missed on his first attempt and the Knicks took the 103-101 loss despite battling the Celtics to the end.

So the next chance he had to beat Boston, he didn’t miss.

Trey Burke's three with 12 seconds remaining seals the deal for the Knicks in Boston.

GAME NOTES

-You don’t want to take anything away from the importance of this Knicks win or the effort they made to earn it, but the Celtics (9-9) are clearly in a bad place right now after three straight losses. “We have a myriad of issues we have to fix,” Celtics coach Brad Stevens said after the game.

Certainly, no one feels sorry for them, especially not here in New York. Boston’s main issues are their three-point shooting (they missed their first 10 from downtown and were 3 for 22 after three quarters before suddenly making 7 of 11 in the fourth). You have to expect they’ll figure it out, especially with all of this talent on the roster. But with Gordon Hayward (19 points) back this season, it seems to have created a logjam of players battling for minutes at the same position. And Tatum hasn’t been the same player he was last season, while Kyrie Irving (22 points and 13 assists) seems to be the only one thriving. Also of note, Terry Rozier (scoreless, no assists) has been in the headlines for some cryptic tweets that some in Boston speculated was suggesting the pending restricted free agent wanted out. Rozier later laughed it off and shot down the notion he was unhappy in Boston.

-Hardaway Jr. saw his streak of 30-point performances end at three games, but he still scored 21 points on 8 of 19 shooting, including 4 of 7 from three-point range. The number he was most concerned with was one no one asked him about, so he brought it up himself in the postgame media scrum. “I should have just given them the basketball,” he said. “Seven turnovers was uncalled for. I need to be better as a ballplayer.”

Tim Hardaway Jr. shares his thoughts on the Knicks victory with Rebecca Haarlow in the locker room.

-The Knicks led by as many as 26 points in the first half and at halftime held a 65-49 lead. The Celtics came out attacking in the third quarter and cut the deficit to 10 points with three minutes left in the third. But that’s when Fizdale sent out his second unit, with the three rookies — Kevin Knox, Mitchell Robinson and Allonzo Trier — with Burke and Frank Ntilikina.

And this lineup actually stabilized the team and built the lead back to 15 going into the fourth quarter. Ntilikina still didn’t put up a lot of stats in the box score, but he did have a notable defensive presence in this stretch. So did Robinson, though his presence was easily quantified by the two blocks he registered in the quarter.

He finished with six blocks total and seemed to be all over the place defensively. It was another glimpse into his potential as the backbone of a defense.

-Knox followed up a couple of quiet games with a much more confident performance. He had 11 points and 9 rebounds in 25:44 and knocked down a couple of big three-pointers early in the fourth quarter to help extend the Knicks lead back to 20 points. Both shots looked smooth by the rookie, who has been trying balance between playing with a fast motor while slowing down his urgency to score. His shooting percentage has been a concern in the early part of the season and some of it has to do with him seeming to be rushed to shoot. Then he went a few games hardly looking to shoot at all. Last night, Knox looked a lot more in rhythm than he has lately. “One thing, growing up, Pop always told me is to let it go,” Knox said of his father.

Kevin Knox explains how the Knicks were able to carry their positive play from Tuesday's game against the Blazers into Wednesday's contest against the Celtics.

“I didn’t really hesitate or do none of that. I didn’t guide my shot. I just took what my normal shot was and let it flow and just knocked it down.”

–Happy Thanksgiving everyone!

[Coverage Of Knicks-Pelicans Begins Friday at 7 PM on MSG & MSG GO.]