James registered the 49th triple-double of his career, but it was Boston, behind more fourth-quarter heroics from Thomas, who got the last laugh on Wednesday night.
"Nobody holds me in check ... I average 30 points for a reason," Thomas said after taking over down the stretch to lead the Celtics to a 103-99 victory over the Cleveland Cavaliers.
Boston's little big man scored five points in the final 49.4 seconds and the Celtics, who had lost three of four since the All-Star break, beat the Cavaliers for their first win in three tries this season against the NBA champions.
"I think it's big for us, especially going on to the west coast. This needs to carry over for us," said Avery Bradley, who hit a big 3-pointer late and played some key defense in his second game back after missing 18 straight with an Achilles injury.
Thomas, the league's leading fourth-quarter scorer, missed three straight free throws in the first 4:13 of the final period. But he blocked a shot by big man Tristan Thompson and set up 3-pointers by Jae Crowder and Avery Bradley before tying the game at 99 with a trey with 49.4 seconds left.
He was fouled on a drive with 28.1 seconds left and made the free throws.
Kyrie Irving missed a jumper, Thompson got the rebound and got the ball out to James who, while double teamed, found an open Deron Williams in the left corner. Williams, in his second game with the Cavs, missed the 3-pointer.
Crowder rebounded and nailed the two free throws with 4.2 on the clock.
Thomas, who had been in a four-game shooting slump, finished with 31 points (92 in three games against Cleveland this season) and five assists, while Crowder had 17 points and 10 rebounds. Al Horford just missed his second career triple-double, finishing with nine points, 10 rebounds and matching a career high with 10 assists. Marcus Smart added nine points and eight assists off the bench.
James, averaging more points against Boston than any other team, finished with 28 points, 13 rebounds and 10 assists, while Irving also scored 28 and Thompson grabbed 13 rebounds.
There were 24 lead changes and 19 ties -- and the Celtics' biggest lead was four, the final margin. They improved to 16-0 at home when leading after three quarters.
"It definitely felt like a playoff game," Cavs coach Tyronn Lue said. "The atmosphere's great. Whenever you come and play in Boston, the atmosphere is unbelievable. The physicality was good. Everybody competed, one through 15 on both sides competed. It was a good game."
Said James, who had triple-doubles against the Celtics in 2006 (regular season) and 2010 (playoffs): "Great game. Executed well by both teams. They made a couple more shots than we did down the stretch, but nothing bad about tonight."
In the fourth quarter, James, hustling for a loose ball, had a mini-collision with Patriots coach Bill Belichick, seated in the first row under the basket.
Asked if that might have been the greatest collision of champions ever, James said, "I don't know if I'm on his level, but I definitely slowed up because I knew it was him. I'm not taking no legend out. I'm not doing that. I need to keep seeing him win, so that's pretty cool for me."
Thomas approached Belichick during a timeout, saying later: "I just wanted to shake his hand and show my respect."
The Celtics (39-22) allowed an average of 126 points in the two earlier losses to Cleveland (41-18) this season.
Bradley played only the first half Monday night, but was there at crunch time Wednesday -- by design, according to Stevens.
"That's what he does, he defends, he hits shots and we need him to do that," Thomas said. "He was a big key for us in today's win."
-- The Celtics held a 47-41 rebound edge and are 18-1 when winning the boards battle this season.
-- Boston hit at least 10 3-pointers for the 19th straight game, the second-longest streak in NBA history (Houston 27 earlier this season).
-- Celtics coach Brad Stevens lauded the Cavaliers' recent acquisitions of Kyle Korver, Deron Williams, Andrew Bogut and Derrick Williams, saying before Wednesday's game: "They're really good and I think they actually might be better when it's all said and done than they were last year." Bogut still has to pass a physical before joining the team.
-- The Cavaliers continue their three-game road trip at Atlanta on Friday, while the Celtics open a five-game road trip in Los Angeles against the Lakers the same night.