NEW YORK — D'Angelo Russell scored 29 points, including six in overtime, and the Brooklyn Nets snapped an eight-game losing streak by beating the Toronto Raptors 106-105 on Friday night.

Brooklyn picked the most unlikely way to end its skid, snapping a 12-game slide against Toronto with its first victory over the Raptors since April 3, 2015.

Jarrett Allen made the go-ahead basket for the Nets with a little more than a minute left, their only basket in overtime not made by Russell.

Kawhi Leonard scored 32 points for the Raptors, but Toronto couldn't get a look for him on its final possession and had to settle for Fred VanVleet's 3-pointer that just missed.

Spencer Dinwiddie scored 17 points for Brooklyn.

Jonas Valanciunas added 24 points for the Raptors.

The Nets led by seven with under 5 minutes remaining in regulation, but Leonard fed VanVleet for a 3-pointer and then scored the next six points himself to give Toronto a 96-94 edge with 2:23 to play. But his shot from in the lane rattled out with 7 seconds to play, and he blocked Dinwiddie's shot on the other end to force OT.

Russell had the first two baskets in the extra session, Leonard made the next two, and the Nets eventually pulled out a close game after they had fallen three times by two points during their losing streak.

NOTES: Nets' Allen finished with 12 points and 10 rebounds. ... Coach Kenny Atkinson said he had no problem with Jared Dudley's comments after they blew a 23-point loss to Oklahoma City on Wednesday, when the veteran forward criticized the team for its repeated mistakes in crunch time. Atkinson said he respected Dudley's honesty, adding that at his urging the players held a film session without coaches during their off day so they could attempt to find solutions themselves. ... NBA assists leader Kyle Lowry of the Raptors had 11 but was just 1 for 8 from the field for three points. ... The Raptors missed their first eight 3-point attempts before Delon Wright made one in the final minute of the first quarter. ... Nets visit Knicks on Saturday night.