Dirk Nowitzki waited five long years for that elusive third victory over Miami, yet there was only a short celebration when it finally came.

To Nowitzki, the real party can't come until next week.

And now it really is "now or never" for LeBron James and the Miami Heat.

Nowitzki scored 29 points, driving for the go-ahead dunk with 2:45 remaining, and the Mavericks beat the Heat 112-103 on Thursday night to take a 3-2 series lead.

The Mavs, who blew a 2-0 lead against the Heat in the 2006 finals, can wrap up their first championship in Game 6 at Miami on Sunday night.

James, who called this game "now or never," responded from his worst playoff performance with 17 points, 10 rebounds and 10 assists, and Dwyane Wade battled through a sore left hip after a first-quarter collision to finish with 23 points.

Chris Bosh had 19 points and 10 rebounds for the Heat, who get the final two games at home with history against them as they try to win a title in their first season together: In the 26 previous finals that were tied 2-2, the Game 5 winner won 19 of them.

Jason Terry scored 21 points and J.J. Barea had 17 for the Mavs, who insisted at some point their shots would start falling even against the Heat's stingy defense. Jason Kidd and Tyson Chandler both finished with 13 points.

James scored eight points in Game 4, going just 3 of 11, the first time in 90 postseason games he didn't hit double figures.

This time, the health concern was Wade, who banged his hip in the first quarter and appeared to be limping at various points from there.

He remained in the locker room to start the second half, coming back onto the court about the midway point of the period. By then, the Mavs seemed in too good a groove to be cooled off no matter who Miami had out there.

A disgusted Heat coach Erik Spoelstra was already walking onto the court to call time by the time Chandler went up to dunk after catching the ball all alone under the basket, giving Dallas a nine-point lead that matched its largest of the series.

The teams were at the same point as their 2006 matchup after four games, but that one was already in the midst of a massive swing by then. Miami won the final four games behind Wade, the MVP of that series.

This one has been developing into one of the closest finals the NBA has ever seen. Games 2-4 were decided by three points or fewer. That hadn't happened in the championship round since 1948, according to STATS, LLC, when the Baltimore Bullets and Philadelphia Warriors played Games 2-4 within a three-point margin during the Basketball Association of America finals, a year before that league merged with the National Basketball League to become the NBA.

And all eyes were on James, just as they have been since he bolted Cleveland for a better shot at a championship in Miami.

He vowed to be more aggressive after his puzzling Game 4. He caught the ball in the post more frequently, but his jumper was still off for much of the game.

James threw up an airball with his left hand on his first shot, and when he did finally score, the Mavs quickly came back with six straight points for an early 13-6 lead, a promising start for a team that had been playing from behind nearly all series.

Wade walked gingerly to the locker room with a left hip contusion with about 3 minutes left in the period after colliding with Mavs reserve Brian Cardinal on a drive to the basket, and didn't return to the bench until more than 3 minutes into the second.