NEW YORK (AP) DeMar DeRozan converted a tiebreaking three-point play with 1:05 left on a night he became Toronto's No. 2 career scorer, and the Raptors beat the New York Knicks 93-89 on Sunday to stay alive for the No. 1 seed in the Eastern Conference.

DeRozan finished with 27 points as the Raptors pulled within two games of Cleveland with two to play for both teams. Toronto won the season series and owns the tiebreaker if the teams finish with the same record.

Kyle Lowry scored 15 points and Jonas Valanciunas had 14 for the Raptors, who set a franchise record with their 23rd road victory.

More from FoxSports

DeRozan has 9,426 points and moved ahead of Vince Carter (9,420). He now trails only Chris Bosh (10,275) on the Raptors' career list.

The Raptors close with games against Philadelphia and Brooklyn, the two worst teams in the Eastern Conference. Cleveland finishes against playoff-bound Atlanta and Detroit.

Carmelo Anthony scored 21 points in just 25 minutes in the Knicks' final home game of the season. Jerian Grant added 19.

DeRozan and Lowry returned to the lineup after sitting out against Indiana on Friday, but the Raptors started poorly and could never shake the Knicks even when the All-Star guards turned it on in the second half.

The Knicks raced to a 21-10 lead, but Toronto recovered to take a 54-51 edge into halftime, then built their own double-digit advantage that the Knicks wiped away in the fourth quarter.

DeRozan then drove baseline to beat two defenders and make a layup while being fouled, giving Toronto an 89-86 lead. Grant followed with a basket, but the Knicks didn't score again and Valanciunas just beat the shot clock with 33 seconds left before the Raptors finished it off from the foul line.

TIP-INS

Raptors: Toronto had won 22 road games in each of the last three seasons. ... The Raptors played without Luis Scola, who was rested and didn't make the trip, and Delon Wright (left hip pointer). ... Toronto closes the season with another trip to New York, visiting the Brooklyn Nets on Wednesday.

Knicks: New York remained without injured starters Kristaps Porzingis (strained right shoulder) and Jose Calderon (bruised right quadriceps). ... The Knicks honored Walt Frazer with the Dick McGuire Knickerbocker Legacy award. The Hall of Fame player has been a broadcaster for the team for 27 years.

UP NEXT

Raptors: Host Philadelphia on Tuesday.

Knicks: Visit Indiana on Tuesday.