TORONTO -- The third quarter was consistently the downfall for the Brooklyn Nets this season.
On Tuesday, they survived the third quarter but nearly faded in the fourth before holding on to defeat the Toronto Raptors 102-100 and snap a five-game losing streak.
Toronto forward Amir Johnson missed a 3-pointer at the buzzer.
"We didn't talk about the third quarter," Nets coach Jason Kidd said. "We just talked about what we did in the first half, what worked and what we needed to continue to look at."
Center Andray Blatche scored 24 points and guard Joe Johnson added 21 points to help the Nets (4-10) win for the first time since they beat the Phoenix Suns in overtime Nov. 15.
Forward Paul Pierce added 16 points, and forward Kevin Garnett scored 12 for Brooklyn.
The Nets led by 15 points with five minutes left in the game, but Toronto stormed back and had possession with 10.7 seconds to play, trailing by two points. Johnson missed his shot after forward Rudy Gay found him with a pass, and forward Steve Novak couldn't tip the ball in on the rebound.
"Against those types of teams, you have to throw the first punch," Raptors coach Dwane Casey said. "You can't wait to get hit like we did tonight and wait until the last (three) minutes and then you start scrapping and playing desperate."
The Raptors (6-8) saw their two-game winning streak end.
Toronto uard DeMar DeRozan scored a game-high 27 points. Guard Kyle Lowry added 24 points, including four points off steals down the stretch, and Novak contributed 12 points off the bench.
"It kind of seemed like we wanted the time to run out instead of going out there and putting a stamp on the game," Pierce said. "That's what we have to do. We have continue to do the things we have been doing, push the lead and not wait for the clock to run out. I thought we were tentative, didn't get in our offense and turned the ball over. Fortunately we had such a big lead or we would have lost tonight."
Kidd said, "I'll take a little of the blame because I probably should have stayed with the group that was going because we were in that situation in Washington (during an overtime loss on Nov. 8). But I was just focused on trying to close the door so we could get a win. We'll get better at that."
The Nets took a five-point lead into the fourth quarter. The lead was up to nine when Garnett made a layup with 9:21 to play in the fourth. Pierce hit two free throws to give the Nets a 91-80 lead.
Johnson hit a 3-pointer to increase the lead to 13 points with 6:35 to play. Blatche grabbed a rebound and scored on a turnaround jumper to increase the lead to 15.
The Raptors cut their deficit to eight when Lowry converted two turnovers into layups, and Johnson reduced the lead to six points on a driving hook shot with 1:25 to play.
Lowry made two free throws with 1:01 to play to cut the lead to 101-97, and the Nets were called for a shot-clock violation with 35 seconds to play. Gay made a 3-pointer, and the lead was down to one.
Nets guard Shaun Livingston sank one of two free throws for a two-point lead, leading up to Johnson's decisive miss.
The play was designed for Gay.
"They loaded in on it," DeRozan said. "(Gay) made the right decision. Amir was open. That's a 3 that he'll make. We can live with that. It was a good look, and if he hits it, we win. But it sucks that we had to fight from so far down with three minutes left."
The Nets increased their four-point halftime lead to 10 in the first three minutes of the third quarter when Pierce scored five consecutive points, including a 3-point shot. Novak cut the lead to three points with a 3-pointer with 1:37 left in the third, and guard Terrence Ross brought the Raptors to within one with a jumper.
Brooklyn led 81-76 when Johnson ended the third quarter with a driving jump shot.
NOTES: Nets F Kevin Garnett, who played his 1,336th game, moved past G Gary Payton into sole position of ninth place for career NBA games played. ... F Andrei Kirilenko (back spasms), C Brook Lopez (sprained left ankle), G Jason Terry (bruised left knee) and G Deron Williams (sprained left ankle) did not play for the Nets. ... Raptors F Quincy Acy (sprained right ankle) missed his third game in a row and is listed as day-to-day. Toronto F Austin Daye also was inactive for the game. ... The Raptors will continue their four-game homestand Friday against the Miami Heat and Sunday against the Denver Nuggets. ... The Nets return home to play the Los Angeles Lakers on Wednesday.