"They had a hard time on the screen and roll," Stoudemire said. "When I rolled to the basket, they were sucking in and Steve was doing a great job of finding open guys."
The victory moved Phoenix into a tie with Utah and Denver for the third playoff spot in the West, a half-game behind No. 2 Dallas, with two to play. The Suns' final two games are at home against Denver on Tuesday and at Utah on Wednesday.
Nash had 23 points and 11 assists for the Suns, winners of 12 of their last 14.
Luis Scola scored 20 of his 30 points in the second half for the Rockets, who rallied from a 14-point third-quarter deficit. Aaron Brooks added 22 points, including 6 of 9 3-pointers, and Chase Budinger had 19 for Houston.
"You can just look at the West and see -- that team is a quality team and they're not going to make the playoffs," Suns coach Alvin Gentry said about the Rockets. "They're a real quality team. They're hard to play. Every game we've played them this year it's been like a roller coaster."
And the Suns won all four.
Nash limped off after taking a shot to the leg with 23 seconds to go, drawing a technical foul as he left the court. He said he was not hurt.
"It's not even worth talking about," he said.
The Rockets led 102-100 after Scola's two free throws. Scola drew a foul for bumping Nash during Phoenix's trademark pick-and-roll play on the next possession. The Suns took the ball out of bounds, Scola backed off a bit, and Nash made the 3, his third in three tries, to put Phoenix ahead for good.
Frye followed with a 3-pointer, Richardson got one, then Frye another and it was over.
"They're a smart team," the Rockets' Trevor Ariza said. "They know what to do and they know when to do it."
The Suns led 62-57 at the break and 81-67 after Jarron Collins' inside basket with 4:56 to play in the third quarter. Scola, though, scored eight in a 13-1 surge to cut the lead to 82-80 with 1:18 to go in the quarter. Frye made his first shot of the night and Nash sank a 3-pointer to boost the lead to 87-80. But Scola responded with a driving bank shot, Budinger intercepted Nash's cross-court pass and made a 3-pointer and it was 87-85 entering the fourth.
Jordan Hill scored to start the final period to tie it at 87-87. Brooks' fifth 3-pointer, the first one he had tried since the opening quarter, put Houston ahead 92-91 with 8:44 to go. the Rockets' first lead since midway through the second quarter.
There were three ties and four lead changes after that before the Suns went ahead for good.
Stoudemire set the tone for the late surge when he made a leaping save of a ball headed out of bounds, then got the ball back for a dunk to tie it at 100-100.
"Amare had a monster game," Gentry said, "but it's nothing he hasn't been doing the last two months really."
Brooks made his first four 3-pointers in the first quarter. While he was 6 of 9 on 3s but only 1 of 9 on 2-pointers.
Houston had won three in a row and four of five. ... The game featured three former University of Arizona standouts -- Frye for the Suns, rookies Budinger and Hill for the Rockets. A fourth, Suns general manager Steve Kerr, watched from the stands. ... Injured Suns C Robin Lopez (bulging disk) is to be re-evaluated by a specialist on Monday. ... Phoenix won its seventh straight home game. ... Houston's Kevin Martin played only 6 minutes in the third quarter and none in the fourth because of illness, Adelman said.