With the teams tied 131-all after the first overtime period, Johnson hit a layup, two treys and a dunk to lift the Heat to the win in their highest point-total game in franchise history.
Johnson finished with a team-high 31 points. Kelly Olynyk had 30, Wayne Ellington 23 and Josh Richardson 17.
Denver was led by Nikola Jokic with 34 points. Wilson Chandler had 26, Jamal Murray 23 and Will Barton 22.
Miami's win coupled with Milwaukee's 124-117 loss in Cleveland moved the Heat into seventh in the playoff race, a half-game ahead of the Bucks.
It was the fifth straight home win for Miami and eighth in its last nine games.
The Nuggets lost their fourth straight on the road and fell to 11-23 away from Colorado.
The teams played a fast-paced, offensive-minded first quarter, with Denver using an 11-0 run led by Barton in the first four minutes to build a 16-5 lead.
However, the Heat shot 58 percent and went on a 31-21 run behind 10 points from Richardson to trail just 37-36 after one.
Jokic led Denver with 10 points while Chandler had eight as the Nuggets shot 62 percent from the field.
The Heat moved ahead in the second behind a trio of 3-pointers by Ellington and the inside play of Olynyk in the first half of the quarter.
A spinning reverse layup by Dragic in the final second gave Miami a 64-63 halftime lead and the half's 11th lead change.
The 64 points were the second most in a half by Miami this season.
The teams played a close third quarter, with the Heat leading most of the period. But Barton scored a layup in the final three seconds to leave Miami holding a 92-91 edge after three.
Jokic's tip-in with 10 seconds left tied the game at 118 to force overtime.
-- Field Level Media
Denver | Miami | |
Nikola Jokic 34 | Scoring | James Johnson 31 |
Devin Harris 9 | Assists | Goran Dragic 8 |
Nikola Jokic 15 | Rebounds | James Johnson 11 |
Jamal Murray 9 | Free Throws Made | Goran Dragic 7 |
Will Barton 4 | Steals | Goran Dragic 1 |
Will Barton 2 | Blocks | Kelly Olynyk 4 |
Team | Points | FG% | 3PM-3PA | FTM-FTA | Assists | Rebounds | Blocks | Steals | Turnovers |
Denver | 141 | 46.0 | 18-38 | 31-37 | 23 | 46 | 5 | 10 | 14 |
Miami | 149 | 54.9 | 20-36 | 17-27 | 36 | 46 | 11 | 5 | 11 |