His three-pointer with 33.6 seconds left sealed the deal as the Lakers avoided being beaten for the second time this season by the NBA’s worst team.
Detroit took a 116-114 edge on a three-point play by Grant with 1min 29sec left in the initial overtime.
But James tied the score with a bucket in the lane with 46.5 seconds remaining.
Two foul shots by Grant with 26.1 seconds gave Detroit a two-point lead.
A Davis dunk knotted the score at 118 with 18.1 seconds remaining but Grant failed to hit his shot from the baseline as time expired in the first overtime.
The Pistons forced the first overtime after Jackson scored on a driving lay-up to tie the score at 106 with 3.1 seconds left.
James missed a contested drive in the lane just before the end of regulation.
Los Angeles failed to score in the final 4min 6sec of regulation.
Both clubs were sloppy handling the basketball, with the Lakers committing 22 turnovers to 20 for the Pistons.