The comeback eclipses the 23-point deficit Houston faced in a 110-107 victory against Portland on Jan. 22, 1977.
The game was tied with 2 1/2 minutes remaining when Houston's P.J. Tucker hit a 3-pointer from the corner. A layup by Rudy Gay got the Spurs within one with just under a minute left before Harden missed a 3 on the other end.
A 3-pointer by Bryn Forbes rolled on the rim before bouncing out with about 20 seconds to go, and Harden made two free throws to extend the lead to 109-106 with 16.2 seconds left.
Forbes missed another 3 with 10 seconds left, but the Spurs got the ball back when Clint Capela knocked the the ball out of bounds while fighting for a rebound. The Rockets then intentionally fouled two times, and Derrick White made a free throw before purposely missing the second one with 2.7 seconds left. But Westbrook grabbed the rebound to secure the win.
Houston fell behind early in a game where Harden had just nine points on 4-of-17 shooting in the first half. He warmed up after the break and finished 10 of 29.
The Spurs managed just 35 points after setting a season high for first-half scoring. LaMarcus Aldridge led San Antonio with 19 points and 13 rebounds, and Forbes had 18 points.
It was the first meeting between the teams since a 135-133 win by the Spurs in double-overtime on Dec. 3 in which a dunk by Harden was wrongly disallowed, leading to a protest by the Rockets. Houston lost the protest, which would have resulted in part of the game being replayed. But the league said it disciplined the officials who got the call wrong and botched the aftermath by not allowing Houston to challenge the ruling.
The Rockets cut the lead to three on a dunk by Capela with about 10 minutes left before DeMar DeRozan scored four quick points to stretch it to 93-86.
A 13-4 run by Houston made it 99-97 with five minutes to go, lifting the Rockets to their first lead since 2-0. The Rockets got four points from Danuel House and a 3 from Harden in that stretch while the Spurs missed seven shots.
The Spurs were up 72-53 at halftime.
Spurs: Dejounte Murray received a technical for pushing Harden in the first quarter. Harden also got a techical. ... White had 16 points off the bench.
Rockets: The Rockets made just 11 of 43 3s. ... Capela had 15 points and 15 rebounds.