The Dallas Mavericks finished strong to seal the 500th win of coach Rick Carlisle’s career.

Dallas did it with dominant defense, a stunner after they allowed more than 60 points in the first half for the second consecutive game.

The Mavs, who entered the game tied with the Sacramento Kings for the most points allowed per game in the NBA, held Portland to only 17 points on 6-of-20 shooting in the fourth quarter. With Elton Brand bodying him up, LaMarcus Aldridge scored only four points in the frame.

The Blazers took the lead with a 10-0 run in the third quarter, fueled by four buckets by Aldridge, who had 14 of his 27 points in the quarter. But the Mavs responded with an 8-2 run to pull within two points at the end of the quarter and took the lead early in the fourth.

Dallas’ lead swelled to as large as nine points in the fourth, but nothing seems to come easy for the Mavs this season. The Blazers, who rallied from a 21-point deficit to defeat the Mavs last week, scored the next six points to make it a one-possession game.

The Blazers had a chance to tie it when Wesley Matthews got a good look at a 3-pointer with less than a minute remaining, but his shot rimmed out. Vince Carter knocked down a dagger jumper on the ensuing possession, putting the Mavs up five with 26.9 seconds remaining.

Carter, who missed Monday’s blowout loss in Oklahoma City due to an illness, delivered 17 points off the bench. O.J. Mayo led the Mavs with 28 points on 11-of-14 shooting, scoring 20 in the first half.

What it means: The Mavs opened their keep-hope-alive four-game homestand with a win over one of the teams that will be fighting for the final playoff berth in the Western Conference. The victory puts the Mavs (21-27) five games behind the Houston Rockets for eighth place in the West. The Mavs are 13-9 at home, where they’ll play six of their next seven games. The Blazers (25-24) missed an opportunity to pull even with the Rockets in the standings.

Play of the game: In a vintage Vinsanity moment, 36-year-old Vince Carter blew by J.J. Hickson with a baseline drive, planted his left foot in the lane and exploded in traffic to throw down a two-hand reverse dunk on the other side of the bucket. The highlight-reel dunk pulled the Mavs within six in the final minute of the first half.

Stat of the night: The Mavs improved to 4-22 this season in games they trailed at the end of the third quarter.