The victory was sweet revenge for Sacramento, which lost by 21 points last week in Miami when the Heat snapped an 11-game losing streak with their most lopsided victory of the season.
Sunday's victory also broke an eight-game win streak in the series by the Heat, who hadn't lost to the Kings since Jan. 13, 2004. A loss left Miami with the worst record (11-46) in the NBA.
The defeat at Miami was part of a 1-4 road trip for Sacramento, which has a 9-22 record away from home.
"We were trying to forget that whole road trip, that was a bad night in Miami and just a bad trip overall," said Martin, who made 14 of 17 free throws.
In the first half, it looked like the same old thing against the Heat, who made nine 3-pointers, shot 68 percent and led by as many as 23 points.
"It was a complete reversal of halves. You cannot rely that you are going to shoot 68 percent the rest of the game," Miami coach Pat Riley said. "They came out aggressive and took it to us. We were really not ready for that and played on our heels."
Trailing 69-49 entering the third quarter, the Kings got going behind the scoring of Martin, whose 3-pointer with 1:23 left tied the game at 87. Sacramento outscored the Heat 41-20 to take a one-point lead into the fourth. It was second-highest scoring quarter this season for the Kings.
"I thought defensively in the second half we held them to 40 points and we only had only three uncontested shots in the whole half," Kings coach Reggie Theus said. "That's how you come back. Consequently, we took over the game offensively."
Dwyane Wade had 26 points and seven assists for Miami, which beat Seattle on Friday night and was seeking only its second win streak all season. Shawn Marion had 19 points and eight rebounds, Jason Williams added 18 points and eight assists, while Ricky Davis scored 14 points.
"Good teams find a way to win and we were not able to do it tonight," Wade said. "We could not spot what they were doing and lost our rhythm. They came out aggressive and started hitting their outside shots."
Beno Udrih had 23 points and nine assists for Sacramento, which has won eight of nine games at home. Brad Miller had 14 points, nine rebounds and seven assists. John Salmons made two 3-pointers late in the game and scored eight points.
"Beno just played a tremendous game, really, really handled the offense extremely well tonight in terms of getting involved and getting in the guts of their defense," Theus said.
After turning the game around in the third quarter in erasing a 21-point deficit, the Kings started the fourth with a dunk by Mikki Moore that ignited a 15-4 run that built the lead to 105-93 with 7:14 to play. The Heat could get no closer than seven points.
"Sometimes in this league you are going to be down 20 points. As long as you keep fighting you are going to get it back," Artest said.
Despite the sideline urgings of Theus, the Heat got open looks throughout a productive first half when Miami shot 68 percent and led 69-49. Wade scored 18 points, Williams had 12 and the Heat bench connected on 11 of 14 shots.
A former first-round draft pick by the Kings, Williams made four straight 3-pointers in the first quarter and had 12 points for the Heat, who led 34-27. ... The Heat are 2-7 with Marion in the lineup. ... Artest made 12 of 22 shots and all four free throws.