Kobe Bryant had 13 points and six assists in 24 minutes before sitting out the fourth quarter. Trevor Ariza also was a factor in the final period, scoring six of his 14 points. Lamar Odom, still adjusting to his new role as a reserve, had 10 points in 19 minutes.
Anthony Parker led Toronto with 14 points. Just 16 days earlier, Parker's sister Candace -- who plays for the WNBA's Los Angeles Sparks -- became the first player to be honored as that league's MVP and rookie of the year in the same season.
Bosh, who played with Bryant on the gold medal-winning U.S. Olympic team, had 11 points and 11 rebounds. Jamario Moon, the first player off the Toronto bench, missed all eight shots in his 14 scoreless minutes.
Forward Andrea Bargnani, who missed Saturday night's 93-89 victory over the Clippers because of a bruised right leg, returned to the lineup and had 11 points in 31 minutes.
Farmar, a 6-foor-2 backup point guard, sent the sellout crowd into a frenzy when he dunked over the 6-foot-10 Bosh at the end of a fast break with 20 seconds left in the third quarter to give Los Angeles an 80-76 lead heading into the fourth.
The Lakers (2-2) opened the final quarter with eight straight points, including a pair of layups by Odom and a dunk by Ariza off an alley-oop pass from Farmar that kissed off the glass.
Farmar victimized Bosh again on a reverse layup with 7:58 to play, then added another layup off a fast break about a minute later to increase the Lakers' margin to 96-82. Luke Walton hit a short jumper that capped a 12-2 run and game Los Angeles a commanding 104-84 cushion with 4:05 to play, and both coaches emptied their benches with 3 1-2 minutes left.
The Lakers led 53-49 at halftime, with no one on either team scoring in double digits. A pair of free throws by Chris Mihm with 7 1/2 minutes left in the second quarter gave Los Angeles its biggest lead of the half, 40-25. The Raptors (3-3) outscored the defending Western Conference champions 20-6 over the next 5:15, slicing the deficit to 46-45 on Jason Kapono's second 3-pointer of the rally.
Despite Farmar's dunk over Bosh, the highlight of the night for the sellout crowd came at halftime -- when public address announcer Lawrence Tanter announced that the Boston Red Sox had lost Game 7 of the AL championship series at Tampa Bay. The video board showed the final out, eliciting a roar from Lakers fans whose team was beaten by the Boston Celtics in the NBA finals last June.