"I knew it was going in," Wright said. "That's what he's about. He's a gamer."
|More on Warriors-Suns|
|More NBA coverage|
Ellis shared Wright's confidence.
"It looked good and felt good," Ellis said. "It was a tough shot but I was locked in and focused on it and it went down for me. Coach just told me to go with five seconds and get a good shot, and I thought I did that."
Channing Frye's 3-point attempt rolled off the back of the rim at the buzzer, giving the Warriors their first victory in Phoenix since March 18, 2005.
Ellis finished with a game-high 26 points, Wright had 23 and David Lee added 22 for the Warriors, who squandered a 21-point lead before rallying in the final 2:16.
"I feel like we executed on both sides of the basketball when it matters most," Warriors coach Mark Jackson said. "If I had to design a win, I would have designed it this way. It was much better for our future to grind out a win."
Golden State played all but 1 minute of the final three quarters and the entire second half without Stephen Curry, who strained a tendon in his right foot with 2:19 to play in the first quarter.
"The way we approached the game sucked," Suns coach Alvin Gentry said. "We end up defending the hell out of the guy and he makes the shot. But that's not the difference in the game. The difference in the game was the first 10 minutes of the game.
"I'm disgusted with the way we played and I'm disgusted with the fact that we got a chance to enter the break on something upbeat and positive and instead we just walk through the first 10 minutes of the game."
Phoenix, behind for only 97 seconds in its previous two games, trailed the Warriors until the final 3:50 when Dudley scored on a layup off a lobbed inbounds pass to give the Suns a 96-94 lead.
Dudley also gave Phoenix its final lead, 100-99, when he scored off an offensive rebound with 2:26 to go.
The Warriors scored five straight to go back ahead 104-100, the last on Nate Robinson's basket with 1:23 to go, only to see the Suns tie the game again on a dunk by Frye with 1:03 left and Grant Hill's layup with 11.6 to go.
"We were panicking," Lee said. "We just didn't show it. We really didn't want to lose this one especially because we've lost 13 in a row here. We held down the fort, got a few stops and some good shots on offense."
Golden State scored the game's first seven points and ran out to a 39-22 lead after one. The Warriors stretched the lead to as many as 21 points, 59-38, before settling for a 59-45 halftime lead.
"We can't have those dry spells and defensively we were bad," Dudley said. "I can't quite put my finger on why we played bad in the first quarter. It wasn't just one thing. Even with that, we got back in the game and battled out way back."
Curry jogged out of the locker room with a minute left in the first half and checked in for the final 18 seconds of the half, but sat out the remainder of the game. ... Warriors F Ekpe Udoh was limited to one shot in 21 minutes by a left knee contusion. ... Golden State's 39 first-quarter points were a season high.. The Warriors won the season series against Phoenix for the first time since 1994-95.