TORONTO -- Rudy Gay scored 32 points, including three free throws in the final seconds, as the Toronto Raptors sent the New York Knicks to their fourth consecutive loss with a 100-98 victory on Friday at Air Canada Centre.
Gay scored 26 of his points in the second half as the Raptors (23-33) beat the Knicks (32-20) for the second time in a row.
DeMar DeRozan added 18 points and Kyle Lowry scored 15 for Toronto, Amir Johnson added 12 and John Lucas 10 after coming off the bench.
Carmelo Anthony led New York with 32 and J.R. Smith scored 19 with Amar'e Stoudemire adding 14 and Raymond Felton 10.
Both teams had a chance to break a 95-95 tie, but it was Lowry who hit a six-foot hook shot to give the Raptors a two-point lead with 28 seconds to play.
Tyson Chandler hit one of two free throws with 21.4 seconds left to cut the lead to one before he fouled out to send Gay to the line with 21 seconds remaining. Gay hit both free throws for a 99-96 lead.
Anthony missed a shot and with 6.9 seconds left and Gay made one of two free throws putting Toronto ahead by four points. Anthony added two points in the final seconds.
The Raptors led by nine points going into the fourth quarter. But Steve Novak's 3-pointer and Stoudemire's dunk got the Knicks to within two with 9:04 to play. Lucas answered with a 3-pointer.
Shortly after Lucas' bucket, a fan ran onto the court, was caught and carried off by security.
The Knicks came back to tie on Smith's 3-pointer and then he made a layup to put New York up by two with 6:09 to play.
But Johnson tied it again at 88-88 with a layup.
Gay made a pair of free throws to put Toronto up 91-89 with 3:53 to play. After the Knicks were stopped on their next possession the Raptors went up by four on Gay's jumper.
Trailing by three at the half, the Raptors took a 56-53 lead with DeRozan scoring six of Toronto's first eight points in the third quarter. The Raptors built the lead up to nine after Gay, who had 17 points in the third quarter, scored on a layup and a jump shot. The lead reached 13 when Gay hit a 3-pointer with 3:02 to play in the third.
The Knicks cut into the lead with Tyson Chandler sinking a couple of free throws to cut Toronto's lead to 79-70 at the end of the third period.
The Knicks led 51-48 at the half on 50 percent shooting from the field with Anthony leading the way with 17 points on 7-for-14 shooting.
The Raptors were shooting 41.5 percent but were 5-for-10 in 3-point attempts. Neither team led by more than six points in the first half and there were 12 lead changes and the score was tied seven times.
Anthony scored 13 points and Lowry had 12 on 4-for-4 shooting from 3-point range, and the teams were tied at 32-32 after the first quarter.
Notes: Backup point guard Sebastian Telfair who was obtained from the Phoenix Suns on Thursday was not in the Raptors lineup for Friday's game against the Knicks. He'll be the third point guard behind Lowry and Lucas. "He's an insurance policy," head coach Dwane Casey said. "Nothing is going to change for our team." ... The Knicks were coming off a 125-91 loss at the Indiana Pacers on Wednesday in which they gave up 74 points in the first half -- 44 in the second quarter -- and trailed by as many as 39 points. "We didn't show up," Knicks head coach Mike Woodson said. It was the Knicks' first game since the All-Star break. They went into the break losing 92-88 to the Raptors at New York. ... The Raptors have held opponents to 88 points in three successive games and won two of them. ... The Knicks are home to the Philadelphia 76ers on Sunday while the Raptors host the Washington Wizards on Monday.