James scored 29 points and Varejao slammed home teammate Sasha Pavlovic's missed shot with 16 seconds left to lift the Cavaliers to an 86-85 victory over the Raptors on Wednesday night.
Varejao had 16 points and 15 rebounds for the second-place Cavaliers, who moved three games ahead of Toronto in the Eastern Conference. Indiana also beat Milwaukee night to overtake Toronto for fourth.
A double-teamed James passed to an open Pavlovic, whose 3-point attempt hit the rim before Varejao emphatically dunked it before falling to the floor for the final points of the game.
"That was definitely the play of the game. I had the best dunk until Andy decided to do that," James said with a smile.
"It was a game-winner. He timed it just right," James said.
Varejao finished 8-for-9 from the field. He had his second straight double-double in place of starting center Zydrunas Ilgauskas, who missed his third consecutive game because of a family health matter.
Varejao said he guessed when and where the rebound would be.
"I saw him, but I went behind him," Varejao said of Bosh. "I took the rebound and put it down."
Bosh had 24 points and 10 rebounds and Andrea Bargnani scored 18 points for the Raptors, whose eight-game home winning streak ended.
"You have to give Anderson credit, he just kicked our butt," Toronto coach Sam Mitchell said. "We didn't put a body on him and he just beat us out."
After James' dunk gave Cleveland a four-point lead, Toronto followed with a 6-0 run capped by Anthony Parker's 3-pointer.
But James made two straight jumpers to cut Toronto's lead to one with just over a minute left.
Bargnani missed badly on a 3-pointer and Bosh missed a 20-foot jumper before Varejao gave Cleveland the lead for good.
"It was definitely a big win," Cleveland's Larry Hughes said. "They've playing well, especially at home. They've moved way up in the standings."
James went 3-for-10 and had 10 points at halftime, but he heated up in the third quarter -- scoring 10 points in the first five minutes of the period.
Cleveland coach Mike Brown said general manager Danny Ferry called him Tuesday night to tell him nothing was going on ahead of Thursday's trade deadline. ... Guard Damon Jones missed the game because of strep throat. ... Benetton Treviso owner Gilberto Benetton sat courtside next to Toronto assistant general manager Maurizio Gherardini, the former GM of Benetton.