Stoudemire scored 42 points, and Nash had 18 points and 17 assists to lead the Suns to a 121-117 victory over the Pacers on Tuesday night.
"It was just a relief that we could make the plays down the stretch and get the stops when it counted, but not a very gratifying win," Nash said.
The Suns rallied in the final minutes. Nash made two free throws with 1:11 left to cut Indiana's lead to 117-115, then he made a 3-pointer with 42 seconds remaining to give the Suns a 118-117 lead.
Indiana's Jamaal Tinsley missed a spinning shot in close, and the Suns rebounded. With the shot clock winding down, Stoudemire's mid-range shot bounced up, then in with 6.5 seconds left to give the Suns a 120-117 advantage.
Indiana's Danny Granger missed a 3-pointer that could have tied the game, and the Suns rebounded to clinch the victory.
Phoenix's quick shots gave the Pacers the chance to overcome a 12-point deficit in the second half.
The up-tempo style the Suns have helped popularize in recent years worked against them in the second half. The Pacers entered the game ranked in the top 10 in the league in scoring, so they were equipped to make the comeback.
"You go up 15, and the way you got up there is also the way they're going to get it back," Phoenix coach Mike D'Antoni said. "So you just have to kind of put your seat belt on and ride through it."
Stoudemire bailed the Suns out, but he almost didn't get the chance. He committed his fifth foul with 6 minutes left, but D'Antoni kept him in the game.
"He did a good job," D'Antoni said. "That's kind of why I keep him in there. Normally, we would take him out if it was a playoff game, but he has to learn how to do that."
Stoudemire shot 15-for-24 from the field and 12-for-13 from the free-throw line. He also had 13 rebounds.
"I felt real good, felt strong," he said. "I just played my game. I took whatever the defense gave me, whether it was a jump shot or an easy layup or two. I just played my style of game, and the team did a great job of playing Phoenix Suns basketball."
Shawn Marion added 14 points and 12 rebounds for the Suns (14-4), who have won three straight.
Indiana nearly made the Suns another of their top Western Conference victims. The Pacers already had beaten Dallas, Utah, Denver and New Orleans.
O'Neal was playing in just his third game since sitting out with knee and shoulder injuries.
"My knee is getting stronger," he said. "At least I'm getting back to where I can compete at the level that people are used to me competing at."
Stoudemire scored 23 points to help the Suns take a 69-64 lead at halftime. The Suns led 66-51 in the second quarter, but the Pacers closed the half on a 13-3 run.
Phoenix led 96-90 at the end of the third quarter after leading by 12 points midway through the period. The Pacers led by as many as five points in the fourth quarter.
"I thought we had a lot of letdowns," Nash said. "Whether it was missing layups or having mental lapses defensively, it's frustrating when we had a game that we could have possibly put to rest almost at halftime, and then all of a sudden, we're losing."
D'Antoni said he doesn't care how the team wins.
"We had about two or three games out there, it looked like. We played well, they played well, and we played well," D'Antoni said. "It ended up on a good note."
Pacers coach Jim O'Brien said F Ike Diogu should be back in a few weeks. Diogu played only the first three games this season before tearing a calf muscle in his left leg. ... O'Neal is averaging 20.7 points and 12 rebounds in three games since he came back from knee and shoulder injuries. ... The Pacers were called for two technical fouls late in the third quarter -- one on C David Harrison and one for defensive 3 seconds. ... Stoudemire notched his third consecutive double-double. ... Tinsley has posted 10 or more assists in eight of his last 10 games.