Nash scored 10 in overtime and Carter had his highest point total since coming from Orlando in a trade on Dec. 18.
Phoenix trailed 90-75 early in the fourth quarter before turning up the pressure on defense, bouncing back from a 132-98 loss in Denver on Tuesday and winning for only the second time in six games.
"This is the type of game, especially after [Tuesday] night, we needed to find a way to win and that's exactly what we did," Nash said. "We were competing but not playing great, then we took a stand. That's all Coach [Alvin Gentry] wanted whether we won or lost in the end."
Reserve Sasha Vujacic scored 19 points for the Nets, who had six players in double figures.
"They're known for their offensive firepower and they got a couple of easy 3s and they got the momentum and made a good comeback on us," Nets guard Devin Harris said. "They went small-ball and they were able to get some mismatches."
Nash's driving layup gave the Suns a two-point lead with 23 seconds remaining in regulation, then Kris Humphries dunked for the Nets with 16 seconds left as the game went to overtime tied at 103.
Vujacic opened the extra period with a 3-pointer, but the Suns took over from there. Carter had a putback with 1:58 left as the shot clock expired for a five-point lead, and Nash hit eight free throws in overtime.
Nash became the NBA's career leader in free throw percentage after making all 11 attempts Wednesday, surpassing Mark Price at 90.40 percent to Price's 90.39.
Channing Frye scored 21 points for the Suns.
Phoenix missed its first seven shots over the second half and had two turnovers as New Jersey opened a 12-point lead in the third quarter. The Nets kept the lead in double figures and extended it to 90-75 with more than 8 minutes left in regulation on Vujacic's 3-pointer before the Suns rallied.
"We can't lose our identity," Gentry said. "With this whole defensive thing that's going through everybody's mind, we still have to be an offensive team. That's who we are."
The Nets had a 57-55 halftime lead, shooting 52 percent from the field in the first half.
Suns forward Grant Hill missed his second straight game due to a sprained knee. Many in the crowd booed Vujacic, a former Los Angeles Lakers player who apparently wasn't too popular during his time in the same division as Phoenix. The Suns improved to 2-2 in overtime games this season, and all four have been at home.