NEW YORK - An eight-minute stretch of the third quarter was all the Knicks needed to turn a double-digit deficit into an insurmountable lead.

Tim Hardaway Jr. scored a career-high 38 points, including 12 during a 28-0 run in the third that sent New York to a 108-100 victory over the Toronto Raptors on Wednesday night.

Kristaps Porzingis added 22 points and 12 rebounds for the Knicks, who outscored the Raptors 41-10 in the decisive period.

“At halftime we had some strong words for each other, we talked about stuff we wanted to do better and we came out in the second half looking like a different team,” Porzingis said.

Kyle Lowry scored 25 points and DeMar DeRozan had 18 for the Raptors, who had their four-game winning streak snapped.

The Raptors shot 0 for 13 from the field during that stretch, which began with Enes Kanter's layup with 10:28 left and didn't end until CJ Miles hit a 3-pointer with 2:23 remaining.

“They came out and overcame our energy, lack of energy, with their energy, and just put us on our heels,” Raptors coach Dwane Casey said. “We couldn't make a shot, short-arming it, missed a couple of layups. They're coming out, scored what, five straight baskets, and again, you let a team like that get momentum as hard as they're playing, you put yourself in a hole.”

The Knicks trailed 59-48 at halftime and were down 62-52 after Lowry's two free throws with 10:47 left in the third quarter. Kanter added five more points during the run, while Courtney Lee contributed seven of his 15 points.

New York took its biggest lead at 89-69 on Doug McDermott's jumper with two seconds left in the third quarter.

The Knicks still led by 18 when the Raptors went on a 12-0 run of their own to cut the deficit to 94-88. But Porzingis converted a three-point play with 5:25 left to end the run and also hit the next bucket, and the Knicks put it away soon after when Hardaway made a 3-pointer.

“I'm just taking what the defence gives me,” Hardaway said. “If I see a lane I'm just penetrating as hard as I can and trying to make the right play at the basket. I'm just playing off the big fella (Porzingis). You've got to keep him happy.”

Toronto led most of the first half and DeRozan's layup with a second left put the Raptors up by 11 at halftime.

“They came out aggressive in the third quarter. We came out in a funk,” DeRozan said. “We couldn't make a basket and couldn't get a stop, and they took advantage of it. It happens. It's the NBA. Some team, some nights, have to go through it.”

Hardaway and Lee each had game highs of seven assists.

TIP-INS:

Raptors: Delon Wright visited the Hospital for Special Surgery in New York on Wednesday and it was decided no surgery is required at this time. His right shoulder was dislocated against New Orleans on Nov. 15. Wright, who missed his third straight game, is averaging 7.6 points in about 21 minutes per game. There is no timetable for his return.

Knicks: The Knicks have now won six games this season in which they've trailed by double digits. ... New York had lost eight straight games to the Raptors. The Knicks' previous win in the series was on Nov. 10, 2015.

CENTURY MARKS

The Knicks are 10-2 when scoring at least 100 points this season. They are 4-0 when holding opponents to less than 100.

DEROZAN DENIED

DeRozan had scored at least 20 points in 10 straight games before falling two points short on Wednesday.

UP NEXT

Raptors: Visit Indiana on Friday.

Knicks: Visit Atlanta on Friday.