Patrick Patterson stole Deron Williams' inbounds pass and made the go-ahead jumper with 6 seconds left, and the Raptors stopped a five-game winning streak by the Nets for the second time this month with a 104-103 victory Monday night.
Toronto dropped Brooklyn to 10-2 in January and opened a 2½-game lead in the Atlantic Division over the Nets, who would be on the doorstep of the division lead if they could solve their neighbors to the north.
"These guys are chasing us but they're putting it together. They're playing well," Raptors point guard Kyle Lowry said. "We're the only team that beat them in 2014. I mean, that's a tough team. They had the game and we made a play and we made a shot."
Brooklyn had a three-point lead with 17 seconds left behind Paul Pierce in his best game with the Nets, but John Salmons scored on a drive with 12 seconds remaining before Brooklyn took its last timeout to move the ball into the frontcourt.
Patterson stole the pass and fed Lowry, who got it back to Patterson for his jumper. Pierce was well off on a final attempt.
"We knew they didn't have any timeouts. We guessed right and Patrick looked like Richard Sherman out there with that steal," Lowry said, referring to the Seattle Seahawks' defensive back who attended the game with a number of his teammates.
Lowry finished with 31 points and seven assists for the Raptors, who clinched a winning record in consecutive months for the first time since December 2009 and January 2010.
Pierce scored 33 points, making seven 3-pointers in a strong bounce-back performance after going just 2 for 10 in his emotional return to Boston on Sunday. He had the Nets in position to win after scoring their last nine points before Toronto stole it.
"Last night was a tough game to play in, so many emotions," Pierce said. "It was good to just get some normalcy back today and I felt comfortable, relaxed. But it would've been better if we got the win today, though."
The stunning turnaround deflated the crowd at Barclays Center for a back-and-forth game that drew a visit from several Seahawks, who will hold their Super Bowl media day Tuesday at the Nets' last home, the Prudential Center in Newark, N.J. Sherman and Bobby Wagner grabbed a baseline seat in the first half, while Russell Wilson and other players sat above in a private box.
Jonas Valanciunas had 20 points and 13 rebounds for the Raptors, who played without injured leading scorer DeMar DeRozan. Terrence Ross, who tied a franchise record with 51 points and made 10 3-pointers Saturday, had a quiet 10 points on 3-of-9 shooting.
But Toronto got a big boost from Patterson, who ditched the mask he began the game with for a recent broken nose and finished with 15 points off the bench.
"This is all about our toughness, our resiliency," Patterson said, "no matter who's out there during the course of the game, no matter who's not playing."
Andray Blatche scored 20 points for the Nets, who lost 96-80 in Toronto on Jan. 11, a night after they played two overtimes in a victory over Miami.
Lowry scored six straight points before Amir Johnson made a pair of free throws during an 8-0 run that gave Toronto a 94-85 lead with about 8 minutes to play. The Nets answered with nine in a row to tie it on Alan Anderson's jumper, and after Valanciunas' basket, Pierce nailed consecutive 3-pointers to make it 100-96 with 2:37 remaining.
"Paul played well," teammate Kevin Garnett said. "He totally carried us for that fourth quarter, that second half, and we all came in and just said at the end of the game we've got to make plays, we've got to close games out and tonight we didn't do that."
Toronto cut it to one and had a chance for the lead when Lowry stole Williams' pass intended for Pierce, but Williams redeemed himself by drawing an offensive foul on Lowry with 19 seconds left. Pierce then made two free throws, but the Nets couldn't overcome Williams' next giveaway.
"Two turnovers in the last minute of the game, it's not what I typically do, but that's how it goes sometimes," Williams said.
There were eight lead changes in an entertaining second quarter, two in the final 1.3 seconds. Anderson's 3-pointer put the Nets up by two, but Lowry beat the buzzer from beyond halfcourt to give Toronto a 57-56 halftime lead.
DeRozan had made 125 consecutive starts. ... Ross, DeRozan and the Nets' Mirza Teletovic were all nominated for last week's Eastern Conference player of the week award, which was won by Atlanta's Paul Millsap.