Taj Gibson's free throw with 1:38 remaining put New York ahead for good on Sunday as the Knicks rallied from a 14-point second-half deficit to post a 124-121 win over the visiting Miami Heat.
Julius Randle score a game-high 26 points to lead seven players in double figures for the Knicks, who snapped a five-game skid after outscoring the Heat 40-27 in the fourth quarter.
Rookie RJ Barrett scored 23 points and Kevin Knox II added 17 points off the bench for New York, which received strong contributions from Reggie Bullock (16 points), Gibson (14) and Elfrid Payton (10) and Kadeem Allen (10).
Jimmy Butler had 25 points and 10 rebounds for the Heat, who have dropped two in a row for their first losing streak of the season.
Kendrick Nunn scored 20 points, James Johnson had 19 and Bam Adebayo and Tyler Herro added 15 points apiece for the Heat.
The Knicks trailed 94-84 entering the fourth quarter but began their comeback by scoring six unanswered points in the first 34 seconds. New York pulled within one point twice in the fourth before Randle's 3-pointer with 2:11 left gave it a 116-114 lead, the first for the hosts since the second quarter.
Johnson responded with a 3-pointer for the Heat before Gibson was fouled on a putback attempt. His second free throw provided the last of the game's 14 lead changes.
Butler followed with an airball and Randle drained a pair of free throws on the next trip down the floor to extend the Knicks' lead to 120-117. Butler's tip-in of his own miss pulled the Heat within one but Randle hit a layup as the shot clock expired to put New York back up three.
Butler was fouled on a 3-point attempt with 21 seconds left and hit the first two before missing the third. Barrett was fouled and drained his first attempt before missing the second, the Knicks' first missed free throw in 14 fourth-quarter attempts.
The Heat had a chance to tie or take the lead on the next possession. Butler, tripled-teamed as he drove the lane, tried a no-look pass to Adebayo, but the ball bounced off Adebayo's hands and to Barrett.
The rookie hit his first free throw and missed the second. The ball bounced out of bounds with a half-second left and the Heat called their final timeout to advance the ball. Adebayo actually hit a 3-pointer off the inbounds pass, but it came well after the buzzer.
--Field Level Media