TORONTO - The Toronto Raptors gave head coach Dwane Casey the toughness he's been looking for and in the process cooled off the red-hot Knicks.

DeMar DeRozan poured in a season-high 30 points and the Raptors handed the New York its first loss in six games with a 96-79 victory on Friday night.

Andrea Bargnani added 21 points and seven rebounds while Gary Forbes chipped in 19 points off the bench for the Raptors (16-32), who took a 106-87 beating in New York on Tuesday.

"It was good to see, especially after the spanking they put on us in New York," said Casey. "They just pushed us out of the way and ran over us to go to the basket. At one time or another you have to take a stand and we did."

Amar'e Stoudemire led the Knicks with 17 points and six rebounds. New York (23-25) came into the game on a five-game win streak and undefeated under interim coach Mike Woodson, who took over after Mike D'Antoni resigned on March 14.

Minutes after putting down an alley-oop dunk late in the fourth, DeRozan fell awkwardly on Jose Calderon while battling for a defensive rebound. He got up gingerly, ran off the floor and into the tunnel.

Casey said after the game that DeRozan just tweaked his left ankle and will be reassessed Saturday.

"I think it scared him more than anything else," said Casey. "He's a tough kid and he's going to be OK."

It was a miserable night for the Knicks' emerging star Jeremy Lin. The Taiwanese-American point guard went 3 for 9 and finished the night with six points.

It was a stark reversal of Lin's last visit to Toronto at the peak of Linsanity, when he nailed a buzzer-beating three to lift the Knicks over the Raptors on Valentine's Day to thunderous applause.

On Friday, Lin heard boos in the second quarter as he clanked two straight three-point attempts.

"I really wasn't even paying attention," said Lin. "I heard a couple boos, but that doesn't really bother me to be honest."

The Raptors, who crumbled late in the game against Chicago on Wednesday, looked shaky early in the fourth as New York pulled to within 70-60 on four points from J.R. Smith and a three-pointer by Steve Novak.

But Toronto held firm thanks to a Forbes jumper and two straight dunks by Bargnani and DeRozan to keep it 82-65 with six minutes to go.

DeRozan wasn't done yet. Calderon set him up for another emphatic alley-oop dunk a minute later and the Air Canada Centre crowd roared as Toronto pulled into a comfortable 21-point lead.

DeRozan said not letting up in the fourth and finishing the game strong was key.

"Usually we throw the first punch in the first and second quarter, but we have to learn to play the whole 48 minutes," said DeRozan. "And that's what we did tonight."

"I was really proud of the guys the way they came out," added Casey. "(The Knicks) threw some haymakers at us throughout the game, and instead of folding we really dug in and fought back."

The Knicks came out aggressive in the third as Lin hit a jumper from the corner and a Stoudemire dunk made it 41-40 just two minutes into the second half.

But DeRozan stopped the Knicks' momentum when James Johnson set him up for a big alley-oop to cap an eight-point run for Toronto and a 51-42 lead at 7:06. He drained two fadeaway jumpers and Raptors had their biggest lead of the game, 60-44 with three minutes left in the third. DeRozan had 14 points in the quarter.

Toronto started the second quarter with a nine-point lead, then stretched that to 31-19 when Linas Kleiza made good on a driving layup. Shumpert had four straight points to key a Knicks run, with Baron Davis stealing the ball from Calderon to make it 31-25 and Stoudemire's put back to pull within four at 6:25.

On a Lin turnover, Johnson drove to the net for a Toronto layup and a 37-31 lead with just over two minutes left in the half. DeRozan closed out the half with a game-high 12 points to send Toronto into the locker-room with a 39-36 lead.

Toronto opened the game with a 11-4 lead behind Bargnani's five points on a three-pointer and a pair of free throws, forcing New York to call a timeout three minutes into the game.

"We came out a little flat, a little lethargic, we didn't have the energy from the start," said Stoudemire. "It is really unacceptable, we have to come out and play hard against a team like Toronto."

Notes: Stoudemire wore a hoodie during warmups in support of slain Florida teenager Trayvon Martin. ... Friday's game was televised in the three languages, including Mandarin for the first time in team history. ... The Knicks and Raptors have met four times this season. ... The Knicks were without forward Jared Jeffries (sore right knee) and guard Bill Walker (sore left elbow). ... Bargnani came into the game averaging just 12.5 per game on 33.7 per cent shooting over an eight-game stretch since returning from a calf injury. ... Toronto guard Jerryd Bayless (left hip pointer) was a game-time decision, but did not play. He's unlikely for Saturday's game against Chicago, said coach Dwane Casey.