The Rockets head into Game 6 on Saturday night in Oakland one win away from knocking off the defending champions and advancing to the NBA Finals for the first time since winning back-to-back titles in 1994-95.
ROCKETS IN :60 SECONDS: Game 5 slugfest at Toyota Center
Chris Paul scored 20 points and James Harden struggled for his 19, but Paul had to leave the game in the final minute with what appeared to be a hamstring injury.
Kevin Durant scored 29 points for the Warriors, who lost in Game 5 of a playoff series for just the second time since 2015.
The Rockets won a second straight defensive struggle between the two potent offenses, leaving the Warriors a loss from missing the NBA Finals for the first time since 2014.
"We had to rely on our defense once again," Harden said. "Game 4, we weren't making shots but defensively we were really good. Same thing tonight."
Draymond Green made a 3-pointer with just over minute left to get Golden State within one. Harden, who was 0 for 11 on 3s, missed his last one with less than 30 seconds left, giving the Warriors the ball back.
Stephen Curry missed a floater and Trevor Ariza grabbed the rebound and was fouled with 10 seconds left. But he made just one of two free throws to give the Warriors another chance.
But Gordon came up with his steal when Green lost control in the lane and added two free throws with 2.4 seconds left to put it away.
Klay Thompson shook off a knee injury that had his status for this game in question to score 23 points and Curry added 22. A bruised left knee kept Andre Iguodala out for the second straight game, and Kevon Looney started in his place.
After losing Game 1 of the series, the Rockets made the best of home-court advantage this time, thrilling a sellout crowd that included Justin Timberlake, Houston Texans star J.J. Watt and rapper Travis Scott.
It's Houston's second straight win in the series after snapping Golden State's NBA playoff-record, 16-game home winning streak with a 95-92 victory on Tuesday night.
Golden State led by one to start the fourth before Paul got going, scoring seven points to power a 10-5 run that gave the Rockets an 81-77 lead with about 9 1/2 minutes left.
Thompson made a 3-pointer after that and then officials reviewed Paul's first basket of the quarter and ruled he got it off after the shot clock expired, leaving the Warriors ahead 80-79.
The Rockets were clinging to a one-point lead with about seven minutes left when Durant fouled Gordon on a 3-point attempt, losing one of his shoes in the process. Gordon made all three free throws to start a 7-2 spurt that extended the lead to 88-82 midway through the quarter.
The Rockets honored the 10 people killed in last week's school shooting in Santa Fe, Texas, before the game, with the school's choir singing the national anthem and team owner Tilman Fertitta wearing a "Santa Fe Strong" T-shirt, before Houston scored the game's first six points in a first half where the team led by as many as 11.
SANTA FE STRONG: How the Rockets are honoring shooting victims
Warriors: Coach Steve Kerr was unsure Thursday if Iguodala would be able to return for Game 6. "He's dying to play, but he's not healthy enough," Kerr said. "We'll just continue to take it day to day."... Curry made four free throws to tie Rick Barry for most free throws made in the playoffs in franchise history with 378. ... Golden State had 18 turnovers.
Rockets: Clint Capela had 12 points and 14 rebounds for his seventh double-double this postseason. ... Houston made 13 of 43 3-pointers, led by four from Gordon.
After Game 6 on Saturday, the Rockets would host Game 7 on Monday if necessary.
Follow the Eyewitness Sports team on Facebook: