The game was held in Montreal as part of the 2014 NBA Canada series.
Kyle Lowry and Lou Williams each added 12 points for the Raptors (7-1), who have now won six straight pre-season games. Toronto's seven wins match the club's pre-season record.
Carmelo Anthony had 24 points for the Knicks (3-4), while veteran centre Amar'e Stoudemire had 11 points and six rebounds.
It was a tight contest throughout, with 17 lead changes, including late in the fourth quarter. With the Knicks ahead 78-77 with less than a minute to play, Williams scored to give Toronto the lead for good. A key takeaway with eight seconds remaining in the game sealed the victory for the Raptors.
Knicks centre Samuel Dalembert, one of only 14 Canadians in the NBA, got the start for New York. Born in Haiti, Dalembert moved to Montreal when he was 14 years old. The six-foot-11 centre, who was drafted by the Philadelphia 76ers in the first round in 2001, finished the game with two points and 10 rebounds in 18 minutes of play.
A Raptors victory looked unlikely early on.
Anthony was unstoppable to start the game, setting the tone with an early three-pointer — his first of two before the interval. The small forward finished the quarter shooting five-for-eight from the field for a game-high 14 points.
The score was tied 24-24 after one.
It was a close contest for much of the first half — with 12 lead changes — and no team taking more than a three-point lead until late in the second quarter.
That's when the Knicks starting pulling away. With four minutes remaining in the half, a Dalembert tip-in shot gave Derek Fisher's men a 38-34 lead, and a lay-up by Anthony put New York further in front 41-36.
A Langston Galloway three-pointer late in the quarter gave the Knicks a 46-38 lead at halftime. Dalembert finished the half with a team-high nine rebounds.
An inspired Raptors team took the court in the second half, scoring 17 unanswered points. A couple of commanding, crowd-pleasing slam dunks by DeRozan and eight points by Valanciunas led Toronto to a 57-48 lead, their biggest of the game at that point.
Down 63-57 to start the fourth quarter, the Knicks slowly clawed at Toronto's lead, coming to within two points with 10 minutes remaining in the game. New York tied the game with seven minutes on the clock.
Five unanswered points by the Raptors late in the game helped lead the team to victory.
The inaugural edition of the Canada Series in 2012 saw the Raptors beat the Knicks at the Bell Centre and the Minnesota Timberwolves beat the Detroit Pistons in Winnipeg. Last year, the Timberwolves played the Boston Celtics in Montreal, a game in which Toronto-born rookie forward Kelly Olynyk scored four points.
The Raptors open their regular season Oct. 29 versus Atlanta at Air Canada Centre, where Toronto will play nine of its first 12 games of the year.
The Knicks' first game is against the Chicago Bulls at home at Madison Square Garden on the same evening.
Notes: Prior to the match, fans at the Bell Centre observed a moment of silence to honour Corporal Nathan Cirillo and Warrant Officer Patrice Vincent. … In attendance at the game were NBA legends Dikembe Mutombo and Muggsy Bogues, and Montreal mayor Denis Coderre. … Montreal is the only Canadian city to host four Raptor pre-season matches. … There were 20,738 in attendance at the Bell Centre.