Chandler didn't sulk when coach Mike D'Antoni bumped him from the starting lineup in favor of rookie Landry Fields.
"I didn't take it personally," Chandler said. "I just took it as he had a better lineup. He's a good coach so I just go along with what he says."
A starter most of last season, Chandler's role changed when D'Antoni sought a way to beef up his bench scoring.
"The reason we want him off the bench is not because he's not good, it's because we need the firepower," D'Antoni said.
Looking for more Knicks news? ESPNNewYork.com has you covered. Blog »
Chandler scored eight points in the final quarter and Stoudemire added seven for New York, which led 74-72 through three.
Stoudemire, the Knicks' prize free agent acquisition, is hoping to lead New York back to the playoffs for the first time since 2004.
"You want to beat the teams you feel you're supposed to beat, so tonight was a big win for us," Stoudemire said.
The Knicks will face a tougher test when they visit the defending Eastern Conference champion Celtics on Friday.
"We'll see if we can steal one," Stoudemire said. "They're playing great so we'll see what we can do."
Andrea Bargnani had 18 points in the first half but just four in the second for Toronto, which had won eight of its previous nine home openers. Chandler's defense played a big part in keeping Bargnani under control after the intermission.
"I wouldn't say it was just me," Chandler said. "Amare came over and helped. We all just played good defense down the stretch."
The Raptors were playing their first game without all-star Chris Bosh, who signed with Miami in the offseason after spending the first seven years of his career in Toronto.
"We're a very resilient bunch," Raptors' Jarrett Jack said. "I thought we showed some fight and some grit out there. There was a point where we got down early. If we didn't make a stand the game could have gotten away from us, and we battled back."
Fields was one of two rookies in the starting lineup, alongside Russian big man Timofey Mozgov. He was slowed by early foul trouble and did not score in seven minutes of action.
Toronto's Reggie Evans had 16 rebounds but the Knicks outrebounded the Raptors 49-45.
Barbosa made a 3-pointer at 10:48 of the fourth, giving Toronto a 77-76 lead, its first since the second quarter. New York reclaimed the lead before Toronto's David Andersen tied it with a 3-point play. But Chandler scored on the next two possessions to give the Knicks a four-point edge, and New York never trailed again.
Jack made two free throws, then added a layup with one minute left, cutting it to 96-93. Linas Kleiza's 3-pointer rimmed out on the next possession and, after a New York miss, Barbosa airballed a 3 from the corner, giving the Knicks the ball with three seconds remaining. Felton was fouled and iced it with a pair from the line.
Toronto trailed by 16 points early in the second but cut the deficit to one, 44-33, with an 11-0 run capped by a 3-point play by Kleiza with 3:52 left. The Knicks held firm and led 51-47 at the break.
Felton scored seven points in the third as New York carried a two-point edge into the fourth.
After injuring his right wrist when he fell in a preseason victory over the Knicks last week, Barbosa played with a brace. Traded to Toronto this summer in the deal that sent Hedo Turkoglu to the Suns, Barbosa said earlier this week he will likely need surgery on his wrist for the second straight season. He missed almost two months last season after having a cyst removed.
New York's Ronny Turiaf left with a sore back after Stoudemire stepped on him following an accidental collision in the fourth. He was icing the area after the game but the injury is not considered serious.
Stoudemire had nine of New York's 16 turnovers. ... Toronto's Joey Dorsey served a one-game suspension for swinging his arm at Chicago's Brian Scalabrine in an Oct. 12 preseason game. ... Bargnani addressed fans before the game, thanking them for their support. ... The Raptors swept the four-game series against the Knicks last season and beat New York in last Friday's preseason finale.