The Suns trailed 108-105 late in the second OT before Robert Hite hit a jumper and Barnes sealed the win with his two baskets.
The win evened the Suns' exhibition record at 3-3. Charlotte is winless in six games.
Charlotte scored the first six points of the first overtime, but the Suns fought back on a driving layup by Goran Dragic, a 3-pointer by Hite and a dunk by Louis Amundson, tying the score at 102, forcing a second overtime.
Again, Charlotte went in front, but the Suns rallied to give coach Terry Porter his first home victory.
Shaquille O'Neal led the Suns with 18 points and nine rebounds. Barnes also scored 18 points, while Hite had 14, and Grant Hill and Raja Bell had 12 apiece. Stoudemire finished with 11 points and four rebounds in 17 minutes.
Playing without star playmaker Steve Nash (sprained right ankle), the Suns took charge early. After Charlotte made the first basket, Phoenix scored the next 12 points and 16 of the game's first 21. During that stretch, O'Neal and Hill each had eight points, with Shaq making all four of his free throws.
Stoudemire, wearing goggles to protect the right eye he injured early in training camp, entered the game with five minutes left in the first quarter. He finished out the period and played the opening four minutes of the second period. In that time, he scored seven points and grabbed four rebounds. He punctuated his performance with a vicious slam dunk over rookie Alexis Ajinca and was fouled, completing a three-point play.
After trailing by 11, 67-56, midway through the third quarter, Charlotte chipped away and whittled the deficit to four, 73-69, at the end of the period. The Bobcats drew even, 77-all, on a jumper by Richardson -- his first basket -- early in the fourth.
Richardson then took the game into his hands, connecting on a 3-pointer, a free throw and three straight jumpers, giving Charlotte an 87-83 lead, which it couldn't hold when Dragic made one of two free throws with 25.3 seconds left, tying the score 94-94.
For the second time during the exhibition season, the Suns will play three games in four nights. They face the Clippers at Los Angeles on Tuesday night, then conclude their preseason schedule with a home game against Oklahoma City Thursday night. Phoenix opens the regular season Oct. 29 at San Antonio. ... The Bobcats finish their exhibition schedule with two games at the Los Angeles Lakers Tuesday and Thursday. They open the regular season at Cleveland Oct. 30. ... Larry Brown, in his first season as Charlotte's coach, is coaching his ninth NBA team. He previously coached Denver, New Jersey, San Antonio, the Clippers, Indiana, Philadelphia, Detroit and New York. ... Suns guard Alando Tucker also sat out the game (left hamstring strain).