While the Miami Heat and its fans were reveling in a 15-point lead with about seven minutes remaining in Game 2 of the NBA Finals on Thursday night, Dirk Nowitzki and the Dallas Mavericks were plotting an incredible comeback. During a timeout, reserve guard Jason Terry said he looked at star forward Dirk Nowitzki in the huddle and told him, “There’s no way we’re going out like this.”

There was too much time remaining for a Mavericks team that has made a habit of coming back from huge deficits this postseason, too much time for Nowitzki to prove that Miami wasn’t the only team with an all-star finisher. Nowitzki scored the Mavericks’ final nine points — including a driving layup with his injured left hand — with 3.6 seconds remaining to give his team a stunning 95-93 victory.

Using a furious 22-5 closing rally, the Mavericks handed the Heat its first home loss this postseason and evened the NBA Finals at a game apiece as the series heads to Dallas for Game 3 on Sunday.

“I think in this league, you have to play till the end, especially, this is the Finals,” Nowitzki said after getting his first Finals win in a building where Miami swept three home games against Dallas in order to win the championship in 2006. “You can be down 20. You have to keep plugging. You never know what’s going to happen in this league. And we kept on fighting. And we got some lucky bounces there.”

For most of the night, Heat star Dwyane Wade was playing on a plane above everyone else on the court — including his supernova teammate. So many times this season, Wade has had to share the spotlight or take the backseat to LeBron James. But on Thursday, against the same team that he single-handedly tortured five years ago, Wade was hopping over Mavericks for dunks, whirling around them for ridiculous floaters and bank shots, and finding his teammates in their favorite spots.

Wade sparked pandemonium at American Airlines Arena with 7 minutes 14 seconds left in the game when, fallling out of bounds with Terry closing in, he leaned back to watch his three-pointer splash through the net. Wade kept his right arm up, wrist cocked, and stomped up the floor as James lightly jabbed him in the chest. Unable to get Wade to crack even the slightest smile, James bobbed his head and gave an approving chuckle.

The basket capped a 13-0 run to give the Heat an 88-73 lead and Wade a game-high 36 points. But after that he was held scoreless and missed his final three shots.

Terry said watching the Heat celebrate in front of the Mavericks’ bench “was really disheartening for us. Then I took another glance at the score and at the time, there was a lot of time left.”

Terry, who finished the game with16 points, scored six consecutive points, then Shawn Marion (20 points) made a driving layup. After two free throws by James, Jason Kidd hit a three-pointer and Terry added another jumper to set the stage for Nowizki, who had been held in check for much of the night.

Nowitzki made an 18-foot jumper, tied the game at 90 on a layup, then gave the Mavericks a 93-90 lead when he buried a three-pointer with 26 seconds remaining. Nowitzki stared down the fans, right hand raised, as the shocked crowd looked on silence. He sensed redemption after letting his team blow a 13-point lead in Game 3 of the NBA Finals against Miami five years ago.

But the Heat quickly responded with James finding Mario Chalmers in the corner for a three-pointer to tie the game at 93 with 24 seconds remaining. Terry had blown his assignment and left Chalmers open, then had Nowitzki tear into him on the sideline.

“I’m sure there was a little cussing involved,” Nowitzki said. “I said, ‘If you’re down 15, you make an amazing run like that and you’re up three, you can’t give up a wide open three.’ ”

Dallas then drew up a play for Nowitzki, who faced up Chris Bosh, then drove around him for the game-winner.

Nowitzki suffered a torn tendon in his left middle finger in the fourth quarter of Game 1 and opted to cover the injury with tape instead of a protective splint. He attempted to play down how it would affect his shooting, but he shot just 3 of 10 in the first half. And, at the start of the second half, Nowitzki drove left and lost his dribble while trying to drive left, setting up a steal by Mike Bibby (14 points) and a fast-break dunk by James.

But after fumbling around for three quarters, Nowitzki had no problem with either hand down the stretch. “I said it would be a non-issue,” James said of Nowitzki. “He’s a great scorer. He understands he can use both hands. He got the left-hand layup to tie the game up at 90, and the game-winner going left once again. So, as far as I can tell, it has no effect on his left hand, at all, if any.”

The Heat had no timeouts remaining, and James found Wade for a desperation shot that hit the back of the rim as time expired. “I have been a part of it. I understand once you don’t close a team down, they get confidence and life,” Wade said. “It’s a different story when you’re up 2-0.”

Dallas has already had two impressive comebacks this postseason, overcoming a 16-point second-half deficit to defeat the defending champion Los Angeles Lakers in the conference semifinals, and using a 17-2 run in the final five minutes to force overtime against the Oklahoma City Thunder in the Western Conference finals.

“If you’re going to win a championship, you’ve got to have the wherewithal to hang in when things are tough,” Mavericks Coach Rick Carlisle said. “You have to keep believing. All year, our guys have believed. And tonight was another good example. They had to win the game. It wasn’t easy.”

James scored 20 points, but went 0 for 4 in the fourth quarter, taking some questionable fallaway three-pointers during the Mavericks’ closing run. Bosh had another poor shooting night, missing 12 of 16 shots and finishing with 12.

“There’s no shock, you know, there’s disappointment,” Bosh said. “We’re faced with a challenge now. We’re going to have to go and win on the road. And we’ve had to do that before, so we shouldn’t be surprised that that’s our situation now.”