DALLAS -- O.J. Mayo was at the center of a play that cost Dallas a game in Portland last week.

He made up for it Wednesday night against the Trail Blazers in a yet another game the Mavericks really needed.

Mayo scored 28 points, Vince Carter hit a big jumper in the final minute and the Mavericks beat the Blazers 105-99 for coach Rick Carlisle's 500th career victory.

Eight nights earlier, Mayo was called for a charge with 1.5 seconds left in a tie game, giving Portland a chance to win. LaMarcus Aldridge hit a jumper at the buzzer, and it wasn't much consolation to the Mavericks when the NBA said the next day that the call should have been a block and Mayo should have been shooting free throws for the lead.

The loss started a 1/3 road trip with the Mavericks struggling to get into playoff contention and keep alive a 12-year postseason streak, meaning the rematch in Dallas was even more important.

"It's an opportunity for us to gain ground in the standings before the All-Star break," Mayo said. "It's a game we needed to win. We remember what happened last week in Portland."

Mayo had 20 in the first half and was mostly quiet before getting two important baskets with Portland trying to rally late in the fourth quarter. Carter put Dallas ahead 99-94 with 26 seconds left on a jumper just inside the 3-point line with the shot clock winding down.

Aldridge had 27 points and 10 rebounds for the Blazers, who had just 38 points in the second half and fell to 1-1 on a six-game road trip.

"I think we definitely had a chance to win tonight," Aldridge said. "I thought we had a tough stretch tonight when they had us down by one and then we had turnover after turnover. We still have to do better."

With Aldridge watching in the fourth quarter, the Mavericks went on a 10-2 run for a 93-86 lead and scored again when Aldridge returned on a dunk by Mayo to go up nine before Aldridge helped Portland get close.

Aldridge had a pair of baskets, and Damian Lillard hit two free throws to pull Portland within 97-94. Wesley Matthews had a chance to tie the score, but his 3-pointer rimmed out with 50 seconds left.

Carter, who finished with 17 points, hit his big shot on the other end. He missed his first game of the season Monday night in Oklahoma City because of illness, and the Mavericks weren't competitive without him.

"There's a reason he's such an important guy to us," Carlisle said. "All year long, he's been one of our facilitators. He came up with a couple of big ones for us when the shot clock was down."

Matthews scored 21 points, while J.J. Hickson had 14 points and 10 rebounds for Portland. Lillard finished with 19 after scoring 15 in the first half.

Dirk Nowitzki had 16 points and eight rebounds for Dallas, with Shawn Marion adding 13 points and 10 boards.

Portland coach Terry Stotts, who was an assistant under Carlisle the previous four years, sneaked across the midcourt line to shake hands with his old boss before the game ended, and Mayo said players gave their coach a standing ovation in the locker room after the game.

Carlisle is the 28th coach to 500 wins and is among five active coaches with at least that many. The others are Denver's George Karl, Minnesota's Rick Adelman, San Antonio's Gregg Popovich and Boston's Doc Rivers. Carlisle's career record is 500-353.

"It's meaningful, but I'm not into that kind of stuff," Carlisle said. "I'm into the day-to-day stuff."

The Mavericks took their first lead on a 3-pointer by Nowitzki early in the third quarter, starting an eight-minute stretch that included six ties, four lead changes and neither team going ahead by more than two.

Portland went back up by eight on a 10-0 run that included eight from Aldridge, who had 14 of Portland's 21 points in the third and scored 10 straight carrying over into the fourth. The Mavericks pulled back within two at 82-80 on a 3-pointer by Carter with 1.9 seconds left in the quarter.

Defense was mostly nonexistent in a first half that ended with Portland leading 61-57.

Mayo's 20 first-half points included a 3-pointer and three-point play on a fast-break layup during a 12-0 run that tied the score at 43-all midway through the second quarter. Mayo was 8 of 9 from the field in the first half.

Lillard and Matthews combined for seven 3-pointers in the first 15 minutes, the last coming from Lillard for a 43-31 Blazers lead with 9:19 left in the first half. Lillard and Matthews were 7 of 11 combined from long range in the first half.

Game notes

Portland committed 28 turnovers in a win at Minnesota on Monday night. It was the most in regulation in the NBA this season. It was the first time the Blazers have won with that many turnovers since committing 28 in a victory at Miami on Dec. 5, 1989. ... The Mavericks had 22 assists for their 16th straight game with at least 20, the longest active streak in the NBA. ... Lillard scored the Blazers' last 12 points in the first quarter. ... Mavericks C Chris Kaman missed his fifth straight game with a concussion.