Clang. That sound was heard with dismal regularity Tuesday night, including when Dirk Nowitzki, of all players, shot 1-for-10 in the first half.

Charlotte, as it does to many opponents, lulled the Mavericks into ugly basketball for the better part of three quarters at American Airlines Center.

In the fourth quarter, though, the Mavericks wisely got the ball to Nowitzki and Monta Ellis and basically got out of the way. Nowitzki and Ellis combined to score Dallas’ final 19 points as the Mavericks rallied for an 89-82 victory.

“It was a good fourth quarter, a good comeback win,” said Nowitzki, who scored 14 of his game-high 25 points in the final period. “But it wasn’t pretty there for most of the night.”

After two straight losses and four defeats in their last five games, the Mavericks didn’t care about scoring style points — especially with a four-game road trip beginning Wednesday night at New Orleans.

That is why Nowitzki beforehand called this a “must-win” game and afterward termed it a “big win.”

It was shaping up to be a brutal loss with the Mavericks trailing 58-46 midway through the third quarter, as well as 67-60 through three periods, at which point they were shooting 35 percent.

Nowitzki said he glanced at the scoreboard and saw that 12-point third-quarter deficit. That’s when he made his second field goal of the night, followed by a 3-pointer.

“I was like, ‘I’ve got to get going; I’ve got to make something happen,’” Nowitzki said.

Nowitzki said he realized at halftime that he wasn’t bending his knees enough on his first-half attempts.

Ellis scored 12 of his 22 points in the fourth quarter. Jose Calderon, returning after a one-game absence with a bruised ankle, scored 12 points and made four of five 3-pointers.

Mavericks coach Rick Carlisle said the biggest shot of the night was Ellis’ running jumper with the shot clock expiring, giving the Mavericks a 78-76 lead with 3:42 left.

“You want the best players touching the ball as much as possible,” Carlisle said of Nowitzki and Ellis. Calderon was asked about Nowitzki’s 9-for-11 second-half turnaround from the 1-for-10 start.

“He can do it,” Calderon said. “He can do anything. Nothing surprises me anymore. He can go 1-for-10, but I’m still going to get him the ball to shoot those shots, for sure.”