NEW YORK (AP) -- DeMar DeRozan scored 26 points, Amir Johnson made the tiebreaking basket with 41 seconds left in overtime, and the Toronto Raptors beat the Brooklyn Nets 127-122 on Friday night.

Brooklyn Nets' Jarrett Jack late in the overtime (AP Photo/Jason DeCrow)

Lou Williams finished with 25 points and Johnson had 24 for the Raptors, who led by 17 in the second half before their fifth consecutive victory turned into a difficult one. Johnson made the tying dunk with 12 seconds left in regulation, and scored inside after DeRozan's shot was blocked to make it 124-122, making him 10 for 11 from the field.

Jarrett Jack scored a career-high 35 points for the Nets, and had 13 assists and eight rebounds. Brook Lopez came off the bench for 35 points and 12 boards.

Brooklyn lost its fourth straight and finished a miserable 3-12 January with its seventh straight home loss. The Nets were winless here for the month, with their last home victory coming on Dec. 29 against Sacramento.

Toronto had a series of double-digit leads during the first three quarters. But it turned into a tight game over the final 10 minutes, and the teams, which played a seven-game playoff series last spring, traded big shots - until Lopez missed a wide-open jumper on the final play of regulation.

He made up for that with a three-point play that tied it at 120, and Jack tied it for the final time at 122-all with 56 seconds to play. The Nets nearly got the ball back after Mason Plumlee stuffed DeRozan, but Johnson came up with the ball and put it in.

Brooklyn missed a couple jumpers on the next possession before DeRozan made two free throws, and Kyle Lowry added one more to finish it out.

A year after the Nets beat them in a Game 7 on their home floor, the Raptors extended the NBA's largest division lead to 13 1/2 games in the Atlantic over Brooklyn, which fell to 18-28.

Trying to solve their home woes, the Nets held a game-day morning workout here for the first time this season, but the Raptors sure seemed more comfortable at the start.

Toronto opened a 12-0 lead before the Nets even had a rebound. The Nets rallied to take the lead early in the second before Toronto regained control behind Williams, who had 18 points at halftime on just four shots. He was 10 for 10 at the free-throw line and made both of his 3-point attempts in just 10 minutes.

It was 66-54 at the break after the Raptors made 59 percent of their shots, and they opened a 17-point cushion in the third, but Jack sparked a 12-0 run early in the fourth that sent the Nets to a 97-93 lead while they held the Raptors without a field goal for nearly the first 6 minutes.

TIP-INS

Raptors: Center Jonas Valanciunas hurt his right ankle in the first half and returned to the locker room to get re-taped. ... Forward James Johnson missed the game after hurting his right hamstring earlier Friday. He will be evaluated Saturday.

Nets: Coach Lionel Hollins said the Nets had only had one other practice here this season, an open practice in the preseason that wasn't even much of a workout. He said he would like to practice here at least once a week, but acknowledged that would be difficult because Barclays Center hosts so many events. The Nets still practice in East Rutherford, New Jersey.

UP NEXT

Raptors: Visit Washington on Saturday.

Nets: Host Los Angeles Clippers on Monday

(© 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)