The Suns have lost consecutive games for the first time this season and Houston won its third straight on the heels of a six-game skid.
Nash wound up with 29 points and Amare Stoudemire added 25 for the Suns.
The Suns closed within two points with 3:06 to play on a shot by Nash, but they could manage only two more points the rest of the game.
A basket by Yao gave Houston a four-point lead with just over a minute remaining and, after a field goal from Nash, the Rockets got a key layup from Steve Francis with 30 seconds left.
After Stoudemire turned the ball over, Alston made another layup for the game's final points.