Even on an off-night by his lofty standards, Dirk Nowitzki still showed why he owns Madison Square Garden.

Struggling all night Monday, Nowitzki sank a 19-footer at the buzzer to lead the Dallas Mavericks to a 110-108 victory over the New York Knicks.

The victory enabled the Mavs (35-23) to complete a 3-0 sweep of this road trip, which also includes victories over Philadelphia and Detroit. The Mavs’ only other 3-0 sweep on the road this season occurred Dec. 28-Jan. 1 when they beat Chicago, Minnesota and Detroit.

Nowitzki’s jumper — his 13th career game-winning shot in the regular season — came after the Mavs forced the Knicks into a 24-second shot clock violation with 10.6 seconds left. The Mavs called timeout, then got the ball to Nowitzki near the top of the key.

And despite being heavily guarded by Carmelo Anthony, Nowitzki hoisted up a shot that clanked off the rim, bounced high in the air and then dropped through the basket as time expired.

Nowitzki, who had averaged 27.2 points for his career in his previous 13 games in this arena, seemed almost apologetic that his last shot settled the game.

“I had no idea where it was going,” said Nowitzki when asked if he knew his game-winner was going in when it left his hands. “That’s probably the ugliest game-winner I’ve ever shot.

“Once it went up I figured it had a chance, but I wasn’t quite sure it was going. Then when it actually went in I didn’t even feel like celebrating it was so ugly, and I kind of turned around and saw the bench running at me I was kind of like I was a little disappointed, but we’ll take the win and move on.”

Nowitzki’s clutch shooting came on a night when the Mavs received a season-high 23 points from Vince Carter, 22 points and six assists from Monta Ellis, 20 points and six assists by Jose Calderon and 12 points from Brandan Wright.

Two costly turnovers from Ellis down the stretch helped the Knicks wipe out a 108-100 deficit with 1:37 left.

Anthony, who scored 44 points, made a 3-pointer to tie the game at 108-all with 50.3 seconds left. Then the Mavericks’ defense set up Nowitzki’s game-winner.