The Cavs' comeback from 21 points down was their largest since they rallied from a 25-point deficit against Boston on Nov. 11, 2006. The Cavs won that game, 94-93.
With the Cavs trailing 63-48 with 7:35 left in the third quarter, they went on a 33-10 run to take an 81-73 lead with 8:49 to go in the fourth period.
The Cavs held the Pistons to 15 points in the third quarter and 22 in the fourth and outscored them 53-37 in the second half.
James' 40 point night was the 41st of his career and his eight of the season.
Antawn Jamison is averaging 18.8 points, 9 rebounds, 2.3 assists and 1.5 steals in the past four games and shooting 50 percent from the field.
Anderson Varejao hit 8 of 10 from the field for 16 points and added 10 rebounds and three assists.
Cleveland has won five in a row against Detroit, three of those at Quicken Loans Arena.