DALLAS -- Dirk Nowitzki and the Dallas Mavericks can't seem to turn comfortable leads into easy wins, even with their playoff fate on the line against teams going nowhere.
They avoided what would have been a damaging letdown against Sacramento on Saturday night.
Nowitzki scored 19 points, including eight in the fourth quarter when the Mavericks wiped out a five-point deficit after leading by 17 in the first half and held on to beat the Kings 103-100.
"It's unfortunate it's been part of our DNA, and I just feel like we're going to snap out of it," said coach Rick Carlisle, whose team has lost six games after leading by at least 16 points this season. "And I know we have to. So I'm a very positive thinker on this."
The Mavericks beat Sacramento at home for the 20th straight time in the regular season, the longest against any opponent in franchise history.
Dallas (44-30) is in a virtual tie with Memphis (43-29) for eighth place in the Western Conference, a half-game behind Phoenix. The Mavericks have eight games left and finish the regular season at the Grizzlies.
Rudy Gay scored 30 for the Kings.
Monta Ellis had 17 points and six assists and Sam Dalembert added 15 as Dallas avoided a second loss to a West also-ran on a franchise-record eight-game homestand that ends Tuesday night against Golden State, the fourth likely playoff-bound opponent in five games.
"We've got to push it," Dalembert said. "We have to go out every night and fight, try to get anything we can get and see if we can get that second chance."
The Kings were up 89-84 after a jumper from Jason Thompson when Jose Calderon started a 10-0 run with a 3-pointer and Nowitzki hit a pair of free throws for a tie.
Shawn Marion made two more free throws to put Dallas back in front, then knocked down a 3-pointer from the right corner for a 94-89 lead. Marion finished with 14 points.
Sacramento had a chance to tie in the final seconds after Ellis missed two free throws, but Travis Outlaw's 3-pointer was short just before the buzzer.
"We played a lot harder, a lot more physical, in the second half," Sacramento coach Michael Malone said. "But we don't want to be having to get down by 17 to do it."
Gay, who had 35 points in another close loss at the Mavericks in January, led Sacramento's push for its first regular-season win in Dallas since Feb. 27, 2003. The Kings won a playoff game in Dallas in 2004 when they eliminated the Mavericks in five games in the first round.
Gay tipped in his own miss for the Kings' first lead at 81-80 with 7:26 remaining in the game and muscled in a bucket after Ray McCallum missed a layup. Gay also had seven rebounds.
With Kings point guard Isaiah Thomas missing his third straight game with a right thigh contusion, McCallum became the first NBA player this season to go the full 48 minutes. He has played six straight quarters over two nights after going the entire second half of a loss at Oklahoma City.
McCallum, who had 16 points and eight assists, was briefly the only guard available when fellow rookie Ben McLemore left with what he said was a mild knee injury in the third quarter before returning in the fourth.
"I felt fine the whole entire game," said McCallum, who has averaged 45 minutes per game in his three career starts with Thomas sidelined. "I knew with Isaiah being out, I would play more. I took a challenge to keep the team in the game and run the offence."
McLemore had ice on both knees and his left shoulder after the game, but said he was fine.
Nowitzki led the Mavericks with seven rebounds and tied Calderon for the team lead with seven assists.
Reggie Evans had a season-high 18 rebounds for Sacramento, and DeMarcus Cousins finished with 17 points, seven rebounds and five assists despite sitting most of the third quarter with four fouls.
NOTES: Kings coach Michael Malone said Thomas might play Monday at New Orleans. ... Kings F Jason Thompson got a technical for complaining about a foul called against him on a three-point play by Marion. It contributed to a seven-point spurt in just 26 seconds that gave Dallas a 50-33 lead late in the first half. ... Ellis has been willing to take charges all season, never better illustrated that early in the third quarter when the 6-foot-11, 270-pound Cousins dribbled the length of the floor before plowing through the 6-3, 185-pound Ellis under the basket.