Reggie Evans, who began the night fourth in the league in rebounding at 11.5 per game, pulled down 14 for the Raptors, who improved to 3-9 and snapped a two-game losing streak. Jose Calderon chipped in 12 points for Toronto.
Elton Brand led the Sixers with 27 points, Jrue Holiday added 17, and rookie Evan Turner had his second double-double with 11 points and a career-best 12 rebounds. Thaddeus Young scored 10 points for Philadelphia (2-10), which has dropped five in a row.
The Sixers played without starting guard Andre Iguodala for the fourth time in the last six games because of tendinitis in his right Achilles'.
Toronto went ahead 87-85 on a short turnaround jumper by Bargnani with 2:22 left.
After Turner hit 1 of 2 from the foul line, Weems converted a layup for an 89-86 advantage with 1:25 remaining.
Weems added the first of two free throws with 49.6 seconds left to give the Raptors a four-point cushion at 90-86.
The game was close throughout most of the fourth quarter. Brand stole the ball and went the length of the floor to give the Sixers an 85-83 lead, but Bargnani came right back with a driving layup to tie the game with 3:05 remaining.
Bargnani scored 18 points in the first half to help the Raptors take a 47-46 lead into the break.
Notes: Bargnani's 3-pointer in the first quarter helped extend Toronto's streak to 954 consecutive games with at least one shot converted from beyond the arc. The Raptors started the streak on Feb. 26, 1999. ... Reggie Evans had 10 rebounds at halftime for Toronto. ... The Sixers were just 1-for-8 from 3-point range.