Coming off a win in their last meeting, the Heat played with confidence early on as Jimmy Butler went 5-5 from the field, including a jump shot at the buzzer that cut the Lakers' lead to 27-22 at the end of the first quarter.
The Miami defense frustrated the Lakers in a back-and-forth second quarter and the Heat went into the break down two points after rookie Tyler Herro's put-back jumper went in just before halftime.
James scored just eight points and committed five turnovers in the first half but was much better in the second, finishing with 28 points including a driving layup where he was fouled after the Heat tied the game 83-83 with 6:22 left to play.
With less than a minute left, Davis hit a long three-pointer to push the advantage to nine and blocked a Butler layup attempt to seal the win and put the Lakers one victory away from their first championship since 2010.
Game Five is on Friday. (Reporting by Rory Carroll in Los Angeles; Editing by Peter Rutherford )