TORONTO — Hey, a win is a win.
"No matter how pretty it was, we pulled it out," Nets guard Joe Johnson said.
Andray Blatche scored 24 points, Johnson had 21 and Brooklyn snapped a five-game losing streak, beating the Toronto Raptors 102-100 on Tuesday night.
Paul Pierce scored 16 points and Kevin Garnett had 12 as the Nets won for the first time since beating Phoenix on Nov. 15.
"Huge, man, huge," Garnett said when asked about the importance of the victory. "We've been struggling."
Brooklyn won for just the third time in their past nine games in Canada, getting the victory despite playing without guard Deron Williams and center Brook Lopez, both of whom are sidelined with left ankle injuries.
DeMar DeRozan scored 27 points and Kyle Lowry had 21 for the Raptors, whose two-game winning streak was snapped.
"They just out-toughed us a little bit," Lowry said. "They're experienced inside and they roughed us up."
The Nets were up 101-86 with 5:22 left but nearly coughed up the lead. Rudy Gay's 3-pointer with 23 seconds left cut it to 101-100 before Shaun Livingston made 1 of 2 from the line with 11 seconds remaining, missing his second attempt.
After a Raptors timeout, Toronto's Amir Johnson missed a potential go-ahead 3-pointer from the corner with one second left, and Steve Novak was unable to tip in Johnson's rebound as the Nets held on.
"That last three minutes was almost a disaster," Pierce said. "Fortunately we built such a big lead. If it was any closer, we would have lost tonight."
An anxious Nets coach Jason Kidd covered his face with his hands as Novak's tip went wide and the final buzzer sounded.
"Those guys in that locker room finally said they'd had enough," Kidd said. "There's a bunch of guys in there with pride and they understood what they had to do tonight."
DeRozan acknowledged that Toronto wasn't able to do what it had planned on the final play, with Gay forced to kick the ball out to Johnson as Garnett closed in.
"It was an isolation for Rudy but they loaded in," DeRozan said. "He (Gay) made the right decision. Amir was open and that's a 3 he can make."
Gay made just three of 12 field-goal attempts and finished with nine points and a game-high seven turnovers.
Pierce credited a positive outlook among the Nets players for ending their ugly losing streak.
"The difference was in our attitude," Pierce said. "There was an attitude adjustment among the players. We're just tired of getting pushed around. This team has a lot of pride, a no-give-up type attitude and guys were really feeling it. Some locker rooms break apart when you go on losing streaks, but I think it's bringing us closer together."
Brooklyn won't have much time to sit back and enjoy the win. They host the Los Angeles Lakers on Wednesday.
"It was great to get a win tonight," Joe Johnson said. "We'll put this game behind us and move on to the Lakers. We know we're going to have a tough one tomorrow at home."
The Nets were also without two top reserves, guard Jason Terry (left knee) and forward Andrei Kirilenko (back).
Livingston was cleared to play despite being elbowed in the head during Sunday's loss to Detroit. He finished with five points, seven assists and six rebounds.
Brooklyn was ahead 16-6 midway through the first but Toronto shot five for six from 3-point range to lead 28-26 after one. DeRozan, who made three 3-pointers, scored 13 points in the first.
Joe Johnson scored seven points in the second, while Garnett and Pierce each had five, as the Nets took a 55-51 lead at halftime.
Brooklyn opened the second half with a 10-4 run, taking a 65-55 lead, but DeRozan scored 11 in the third to keep Toronto close. Johnson had nine points for the Nets, who held an 81-76 lead heading into the fourth.
NOTES: Toronto's Quincy Acy (right ankle) missed his third straight game. ... Brooklyn's 25 assists were a season-high. ... Garnett played his 1,336th career game, moving him past Gary Payton into sole possession of ninth place in the NBA all-time. ... Brooklyn improved to 2-7 on the road and 4-0 overall when leading after three quarters. ... Toronto fell to 0-5 when allowing 100 points or more. ... Canadian tennis star Milos Raonic attended the game.