The Heat, who lost last year's championship in six games to the Dallas Mavericks, closed in on the title by playing with a fierce determination that extended beyond their Big Three of LeBron James, Dwyane Wade and Chris Bosh.
"We're focused. We're thinking about Game Five right now," said Bosh, all business after the exciting victory on their home court.
Stalwarts James and Wade made crucial plays down the stretch, but it was Chalmers who supplied the steady firepower that enabled the Heat to hold off the Thunder, who got a sensational effort from Russell Westbrook, who scored 43 points.
"I just try to step up," said Chalmers, who shot 9-of-15 from the floor including 4-of-5 in the fourth quarter. "I've always been a person to try to step up in big moments, and what bigger moment besides tonight and Thursday to step up."
James, after going to the bench late in the fourth quarter with cramping in his legs, returned to hit a key three-pointer that snapped a 94-94 tie and Wade followed with a bold drive to the hoop to put Miami five points ahead.
Lifting the Heat all through the fourth quarter was Chalmers, who scored 12 of his 25 points in the last period.
"Mario Chalmers is a winner, he's shown it his whole life," said Wade, who also had 25 points, one fewer than James, who watched the last minute from the bench nursing his aching legs.
"Coach said earlier, 'keep believing in Mario because he's due, he's due for a big game,' and he came through for us."
Russell Westbrook single-handedly kept the Thunder in the game and finished with 43 points, but made a costly error in the final seconds that denied the Thunder a chance to tie the game.
With 17.3 seconds left and the Heat leading 101-98 with the shot clock set at five seconds for Miami, there was a jump ball called between Udonis Haslem and James Harden.
The tip bounded toward the corner. Instead of allowing Chalmers to gather it and heave a desperation shot to beat the shot-clock, Westbrook fouled him thinking he had to put him on the line to give the Thunder a chance.
Chalmers sank two free throws that effectively clinched the victory for Miami, now one win away from the title with Game Five on their home court on Thursday.
"It was just a miscommunication on my part," said Westbrook, who early in the fourth quarter made all 13 Oklahoma City points during a stretch in which they rallied back from a seven-point deficit to tie the game 90-90.
Thunder coach Scott Brooks admitted there was confusion over the play at the end, but would not pin the loss on Westbrook's costly foul.
"It was a tough play. Could have been a communication thing," said Brooks, who did not huddle the team up to make sure the shot-clock situation was understood.
"I tell our guys, one play does not determine the outcome of a game. There's 200 plays involved in every basketball game, it doesn't come down to one play."
Oklahoma City raced out to a big first-quarter lead and then withstood a Heat comeback to hold a 49-46 lead at halftime.
The Thunder, who suffered from cold starts in the first three games of the series, claimed a 33-19 lead at the end of the first quarter, scoring from inside and out and taking advantage of some poor shooting by the Heat.
But Miami scored the first 13 points of the second quarter to get back into it at 33-32 less than four minutes into the period and waged a tug of war battle right up to intermission.
The Heat kept the pressure up on the Thunder in the third quarter and entered the pressure-packed final stanza with a 79-75 lead.