DALLAS(AP) For weeks, the Dallas Mavericks have been doing all they can to avoid a first-round matchup against the Los Angeles Lakers, using their best stretch of the season to step out of that.

On Monday night, they almost wasted it - against a lottery team, no less.

Trailing the Minnesota Timberwolves by seven points with 3:13 left, Dirk Nowitzki got his teammates going, then Jason Terry finished off the rally by swishing an 18-foot jumper from the right side with 0.2 seconds left for a 96-94 victory.

"The guys stuck together and said, 'There's a lot on the line here. Let's find a way.' And that's exactly what they did,'' Mavericks coach Rick Carlisle said.

A loss would've knocked Dallas out of the running for the No. 6 seed in the Western Conference and given Utah a clear path to No. 7.

Now, the Mavs go into the finale on Wednesday night - at home, against Houston - with a win wrapping up No. 7 and a chance to get No. 6 if they win and New Orleans loses in San Antonio.

"This was one we had to get,'' said Nowitzki, who had 34 points and nine rebounds.

The Hornets were getting drubbed by the Rockets on Monday night, a score that was announced during the fourth quarter of this game. Terry and Nowitzki insisted they hadn't noticed the lopsided score on the board across from their bench or heard anyone mention it until then.

It's easy to believe them considering how much attention they had to pay attention to Minnesota.

Despite their lousy record, an 11-game losing streak against the Mavericks and a 13-point deficit just a few minutes into the game, the Timberwolves grabbed control in the second quarter and refused to budge.

Craig Smith came off the bench to score a season-high 24 points and Sebastian Telfair had 14 points and tied his season high with 12 assists. Minnesota players were jumping up and down on the bench, hoping to make amends for what happened on their last visit to Dallas - when they blew a 29-point, third-quarter lead.

Instead, they found another heartbreaking way to lose.

"This is the second time we had them here,'' Telfair said. "We wanted to win the game and we fought. This would have been a nice win for us.''

Dallas was without Josh Howard, who rested his gimpy left ankle, and his energy was sorely missed. So was his scoring as Dallas went 8 minutes, 32 seconds between baskets over the middle two quarters, missing 14 straight shots along the way.

Nowitzki scored 17 of the club's first 19 points in the third quarter. He was such a one-man show that no other Mavs player even took a free throw until the fourth quarter.

Down the stretch, Nowitzki made plays at both ends of the court, like knocking a ball from Telfair to force a 24-second violation; a steal; a layup with 41 seconds left to tie it at 94; and - most important of all - knocking the ball from Telfair with about 4 seconds left on a play that was credited as a steal by Erick Dampier, who ended up with the ball and called time out with 2.7 seconds left.

Terry went over to his coaches' huddle and said, "Give me the ball! Give me the ball!'' - something he said he hasn't done all season.

He ended up taking the inbounds pass from Jason Kidd, shaking Telfair and nailing his open shot, putting the Mavericks ahead for the first time since 53-52. Although Terry is usually the player who works hardest to juice up the crowd, this time he turned around with no expression while the building erupted in cheers.

"I just knew I was going to make it,'' Terry said. "I felt something.''

Said Nowitzki: "He made a heck of a play. He's our closer.''

The Timberwolves had one last gasp chance, but - guess who? - Nowitzki got a hand on the inbounds pass.

Terry scored 22. The only other double-digit scorer was J.J. Barea with 12. Kidd had six points, eight assists and six rebounds. Dampier had six points and 13 rebounds.

This was win No. 49 for Dallas. A victory in the finale would make it nine straight years with 50.

Notes: Nowitzki extended his NBA-best streak of 20-point games to 24 in a row. ... Barea should've looked more before a no-look, crosscourt pass in the second quarter; it hit the rim and backboard. ... Minnesota coach Kevin McHale on coaching: "It's like being a player but not getting to play, which is the only fun part about being a player. It's all that without the fun.'' Carlisle is hoping his former teammate sticks around. "I hope he comes back because I think it's great to have legendary players involved in the league,'' Carlisle said.


Copyright 2009 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited