Martin shot 9-for-10 from the field and didn't miss until 1:40 remained in the game, J.R. Smith scored 14 points and the Knicks earned their 41st win. That guaranteed they'll reach the playoffs for the third straight season, something they hadn't done since a 14-year streak of postseason appearances from 1988 to 2001.

The league's second-leading scorer, Anthony has 57 total points in his past two games after missing six of the previous eight with a sore right knee.

The defeat was a double blow for Toronto, which lost for the 11th time in 15 games and saw forward Rudy Gay leave in the second with a sore back. He did not return.

Alan Anderson scored a career-high 35 points, DeMar DeRozan had 18 and Jonas Valanciunas 10 as the Raptors lost their third straight. Kyle Lowry led Toronto with 10 assists.

Down by 14 points midway through the third, the Raptors rallied to make a game of it in the fourth. A three-point play by DeRozan cut it to 84-82 with 6:17 left, but Anthony answered with a three-point play of his own, keying a 10-2 run that put the Knicks up 94-84 with 4:00 remaining. New York held on till the end.