Scottie Barnes had 12 points and a career-high 15 rebounds and Pascal Siakam had 13 points and 12 rebounds for the Raptors, who let a 20-point first quarter lead slip away but held on to win their third in four games.
Toronto has held its opponent below 100 points in four of its past five games.
"Coach has been harping on defense," Trent said. "We've been working at it, we've been getting after it. Every day when we come in, we're putting the pieces together, slowly but surely figuring it out."
The Knicks' Obi Toppin scored a career-high 19 points and added 10 rebounds, Julius Randle had 13 points and 14 rebounds, and RJ Barrett scored 19 points.
New York trailed 30-10 less than 10 minutes into the game and lost for the sixth time in their past eight.
"It's a shame not to come out of here with a win, but the way we started the game really hurt us," Knicks coach Tom Thibodeau said.
The Knicks also fell behind by double digits in the first half of Wednesday's loss at Indiana.
"We've got to have our intensity going from the beginning of the game," Barrett said. "We can't let teams come in and hit us first before we decide to wake up and play."
Barrett's 3 with 2:48 remaining brought the Knicks to within three at 86-83, and his driving shot on the next possession made it a one-point game with 2:05 to go.
After Trent committed an offensive foul, Derrick Rose made a jump shot to give the visitors an 87-86 lead, but Trent's 3 with 1:11 left put Toronto back on top, 89-87.
Trent's big shot came after Barnes grabbed the rebound on VanVleet's miss. Toronto finished with 48 rebounds to New York's 55.
"We outrebounded them but we gave up costly ones when it counted the most," Thibodeau said.
Both teams missed shots before Randle's potential game-winning 3 rimmed out with 3.2 seconds to play. Trent was fouled and made one of two, putting Toronto up 90-87 with 0.6 seconds to go. Barrett got a shot off before the buzzer, but it fell short.
"Definitely a great look for what we had on the clock," Barrett said.
Siakam shot 3 for 13 in the first half, and finished 3 for 18, but went 7 for 8 at the line.
"Just one of those nights for him, not quite knocking them down," Raptors coach Nick Nurse said. "But I thought he played a really good game."
The Raptors led 31-14 after one, with five of their nine made baskets coming from 3-point land. Things changed in the second, and Immanuel Quickley's 3 with 4:43 left in the half capped a 29-9 Knicks run over two quarters that tied the score at 39-39. Siakam scored the final four points of the half, and Toronto led 50-42 at the intermission.
The Raptors took a 69-65 lead to the fourth.
CHECK YOUR HEALTH
One day after Raptors president Masai Ujiri announced he was among those to test positive for COVID-19 after attending his charity gala Sunday, Toronto Public Health asked anyone at Sunday's sold-out game against Washington to self-monitor for symptoms for 10 days. The Raptors have announced capacity crowds of 19,800 at all 14 home games this season.
Raptors super fan Nav Bhatia missed a home game for the first time in franchise history, staying home to isolate because he was at the Ujiri's charity gala. "My heart is breaking right now," Bhatia wrote in an Instagram post. Bhatia gave his baseline ticket to actor Kal Penn, who intends to produce and star in a movie about Bhatia, the first fan inducted into the Naismith Memorial Basketball Hall of Fame.
DRAWING A CROWD
The Toronto-born Barrett had almost 1,000 friends and family at the game, his second in Toronto. Barrett had 300 friends and family in the crowd for his first pro game there in November 2019.
Knicks: New York's most recent road win against Toronto was a 111-109 victory on Nov. 10, 2015, when the referees missed Knicks star Carmelo Anthony step out of bounds on a pivotal play late in the game. ... Knicks starters Noel and Alec Burks went scoreless in the first half. ... Rose scored 11 points.
Raptors: New York's bench had 20 points in the second, outscoring Toronto's entire team (19 points). ... All five Raptors starters scored 10 or more points. ... Toronto was without forward OG Anunoby (left hip) and center Khem Birch (right knee) for the 11th straight game. Center Precious Achiuwa (sore right shoulder) missed his second straight.
Knicks: Host Milwaukee on Sunday.
Raptors: Host Sacramento on Monday.
Gary Trent Jr.'s 3-pointer seals Raptors' win
Gary Trent Jr. sinks a 3-pointer in the final minute as the Raptors hold off the Knicks for a 90-87 victory.