Humphries ended with 18 points and 17 rebounds for New Jersey, which will face Toronto again on Saturday. The back-to-back games are the first regular season NBA contests held in Europe.
The Nets snapped a six-game losing streak after getting 16 points and 11 assists from point guard Deron Williams, who got his first victory in a New Jersey uniform. The club acquired him from Utah last week.
A close game boiled down to the fourth quarter, and Nets reserve guard Sundiata Gaines helped his team gain an advantage for the stretch. His three- point play and layup with nine minutes left broke a tie and immediately gave New Jersey a two-possession lead.
Damion James added a jumper to make it a 91-84 contest.
After Bargnani countered with a three-point play, Gaines hit a jumper to start another 7-0 run. Lopez's jumper with 6:41 remaining capped the rally and gave the Nets a 98-87 advantage.
New Jersey continued to make shots in key situations down the stretch, preventing Toronto from trimming its deficit to a single possession. After DeRozan's layup with 4:36 left pulled the Raptors within five, Williams and Lopez answered with buckets on consecutive Nets touches.
Toronto's James Johnson then sank a layup to make it a 104-97 game with 3:01 on the clock, but Williams drilled a three, and New Jersey held on from there.
The Nets held a 27-23 edge after the first quarter, but the Raptors pulled ahead by halftime, 51-47. The first half was tight throughout, as neither team led by more than seven or held onto a lead for very long -- there were five lead changes and nine ties.
New Jersey starting guard Anthony Morrow left the game after hitting his head...James finished with 15 points for the Nets, who shot 55.6 percent...The Raptors got 12 assists from Jose Calderon and 12 points from Ed Davis...Toronto had won the previous six meetings.