Dallas can now lift the title by winning either one of the final two contests in the best-of-seven series, but will have to complete the feat on enemy territory in Miami, where the teams split opening pair of games.
The Mavericks went on a 15-3 run to finish off the Heat, turning a three-point deficit into the comfortable victory amid chants of "Beat the Heat" from a boisterous crowd of 20,433.
Sharpshooting guard Jason Terry had two three-pointers during the game-ending run, finishing with 21 points on eight-of-12 shooting as he added six assists.
Dallas Mavericks' Dirk Nowitzki celebrates his basket against the Miami Heat in the fourth quarter during Game 5 of the NBA Finals basketball series in Dallas, June 9, 2011.
Dirk Nowitzki scored 29 points to lead the Mavericks, while Dwyane Wade tallied 23 for the Heat and Chris Bosh added 19.
"Were a very resilient team. We've been in tough battles all playoffs long," Terry said in a courtside interview. "It's not going to stop, it's going to get even harder but we're ready.
"We're determined and this is our time. I felt great, I was in a rhythm and I came out aggressive... something we have to continue to do.
"We're not happy with our defensive performance, but offensively if we score 100, I told you what will happen."
LeBron James, criticised for his eight-point effort in the Mavericks' 86-83 victory in Game Four, finished with a modest 17 points but had 10 rebounds and 10 assists.
Dallas Mavericks' Jason Terry celebrates a basket against the Miami Heat during Game 5 of the NBA Finals basketball series in Dallas, Texas June 9, 2011.
James, however, disappeared once again in the fourth quarter and could only tally two points. The former scoring champion and two-time MVP has now amassed a combined 11 points in the final quarter of the entire series.
Dallas shot 56.5 percent from the floor but was outrebounded 36-26 by a Miami team that committed 16 turnovers on the way to registering consecutive losses for the first time this post-season.
Dallas coach Rick Carlisle said Terry took on the responsibility of team leader when the Mavericks' best player, Nowitzki, was on the bench.
"He played great, and during periods where Dirk was out of the game we were going to him and he was delivering," Carlisle said.
"Those are tough minutes for us because it's hard when Dirk is out of the game.
"But it's the total game we've all been preaching to Jet (Terry) since the playoffs began and tonight he did a terrific job."
Terry added that he did not want the series to go to a Game Seven.
"We want to get this first one," he said.
The Mavericks took initial control with a 15-6 run midway through the third quarter to turn a 65-65 tie into a 80-71 advantage with just over three minutes left in the period.
But Miami chipped away and a jam by defensive-minded Udonis Haslem gave the Heat a 96-95 lead with 5:16 left, setting the stage for the dramatic finish.
Miami Heat's LeBron James pauses during a break in play against the Dallas Mavericks during Game 5 of the NBA Finals basketball series in Dallas, June 9, 2011.
Miami Heat's Lebron James scores a basket against the Dallas Mavericks' in the first half during Game 5 of the NBA Finals basketball series in Dallas, June 9, 2011.
Dallas Mavericks' Jason Kidd sinks a three point basket against the Miami Heat late in the fourth quarter during Game 5 of the NBA Finals basketball series in Dallas, Texas June 9, 2011.
Dallas Mavericks Dirk Nowitzki (C) dunks the ball between Miami Heats Mike Miller (L) and Chris Bosh (R) in the fourth quarter during Game 5 of the NBA Finals basketball series in Dallas, Texas June 9, 2011.
Miami Heat head coach Erik Spoelstra (L) watches Chris Bosh (2nd-L) as he is guarded by Dallas Mavericks' Jose Juan Barea (2nd-R) and Ian Mahinmi (R) during Game 5 of the NBA Finals basketball series in Dallas, June 9, 2011.