Curry finished with 35 points, seven rebounds and six assists, The Associated Press reported.
Thompson had 27 points and nine rebounds while Kevin Durant added 33 points, eight rebounds and eight assists.
Two days after a 20-point home loss to NBA-leading Toronto, the Warriors put up 103 points through three quarters, went stagnant for more than eight minutes in the fourth before outscoring the Kings 17-2 over the final 3:03.
Durant had 13 points in the fourth quarter, including eight of the first 10 during Golden State's late surge, but Thompson came up with the biggest shot with his fourth three-pointer of the night.
The Kings repeatedly left Thompson unguarded throughout the game and paid for it in the end when his 27-footer put the Warriors up 126-125.
After De'Aaron Fox missed a jumper, Curry made two free throws with 14.8 seconds remaining. Buddy Hield's desperation three-point try also missed, and Curry added two more free throws to close out Golden State's second win over Sacramento this year.
Draymond Green had 14 rebounds and 10 assists for the Warriors.
Hield scored 27 points for the Kings. Fox had 25 points, nine assists and six rebounds. Willie Cauley-Stein finished with 22 points and 11 rebounds.
The wild ending was in stark contrast to the first half when Golden State controlled the pace and the flow while leading by 16.
The Warriors came out much crisper and sharper offensively than they had been in their 113-93 loss to the Raptors two nights earlier.
Curry, Durant and Thompson combined for 51 point and nine triples, and Golden State had a 13-2 run late in the second quarter to go up 76-64.