Chandler's 3-pointer with more than two minutes left gave the Knicks the lead for good at 97-96.
Al Harrington replaced him in the starting lineup after Chandler had averaged just 3.3 points on 25 percent shooting over his previous three games. He was 6-of-10 Monday and added seven rebounds and three assists.
Tracy McGrady led Houston with 20 points in his second game back from a left knee injury.
The Rockets were playing without center Yao Ming (sore right knee) for the second straight game.
Houston led 89-80 with less than eight minutes left when the Knicks went on a 14-5 run to tie the game.
Nate Robinson scored nine points during the spurt. Chandler had the rest on free throws, including three after Chuck Hayes fouled him on a 3-point attempt.
After Luis Scola scored inside to break the tie, Chandler's 3-pointer put the Knicks ahead to stay.
Robinson led the Knicks with 19 points. David Lee had 17 points and 13 rebounds.
Scola had 16 points and 14 rebounds for Houston.
The Knicks led by seven early in the second quarter when the Rockets went on a 12-2 run behind two 3-pointers from Aaron Brooks and three dunks. Carl Landry slammed home an offensive rebound and an alley-oop pass from Brent Barry. Von Wafer's steal and fast-break dunk gave Houston a 43-40 lead.
The Knicks won after trailing through three quarters for the first time this season. They had been 0-20.