The Rockets were up by nine before the Golden State scored the next seven points, capped by a 3 from Stephen Curry, to get within 110-108 with 19 seconds left. Harden made one of two free throws with 11.5 seconds left. Kevin Durant missed a 3 after that. But the Warriors got the rebound and Curry also missed a 3-point attempt before Golden State was forced to foul Chris Paul.
He made one of two free throws with 2.9 seconds left to secure the victory.
After losing the first two games of the series on the road, the Rockets head back to Golden State for Game 5 on Wednesday night with momentum on their side after their overtime win in Game 3 before Monday night's victory.
The Warriors got 34 points from Kevin Durant, who had 46 in the Game 3 loss. Curry, who was criticized after shooting 7 for 23 in Game 3, got off to a good start, scoring 11 points in the first quarter. He cooled off after that, but finished with 30 points on 12 of 25 shooting.
Eric Gordon added 20 points for Houston and P.J. Tucker had 17 points and 10 rebounds.
Houston made 17 of its 50 3-point attempts, while the Warriors shot just 8 of 33 from downtown with Curry making just 4 of his 14 attempts.
The Rockets were up by nine after three and used an 8-2 run, with four points from Harden, to open the fourth and extend the lead to 101-86. Golden State used an 8-3 run, with six points from Draymond Green, to cut it to 104-94 midway through the quarter.
Houston had a 10-point lead with about four minutes left before a 5-2 run, with a 3 from Curry, got them within 108-101.
Green was shaken up when Harden inadvertently knocked him in the head on the follow through after he made a 3-pointer that put Houston up 71-59 with nine minutes left in the third quarter. Green fell to the court where he remained holding the left side of his head for a couple of minutes. The Warriors called a timeout and he collected himself and remained in the game. The lead grew to 77-60 before Golden State got going.
Warriors: Green had 15 points and 10 rebounds. ... Thompson made 11 points on 5 of 15 shooting. ... Golden State trailed by as many as 17 in the second half before its late surge.
Rockets: Danuel House missed his second straight game with inflammation in one of his toes. ... Tucker has scored at least 10 points in six of Houston's nine playoff games this season and Monday was his third straight game with at least 10 rebounds. ... Austin Rivers had 10 points.
Game 6 will be in Houston on Friday night.