David Lee added 18 points and 10 rebounds, and Stephen Curry scored 12 to put the Warriors ahead by 13 points early in the fourth quarter. The Hawks hacked that lead to two but Barnes and Jarrett Jack each made a pair of free throws to seal Golden State's victory.
Lou Williams scored 18 points, including three straight 3-pointers that whittled the Warriors' lead to a basket with 11.2 seconds remaining. Josh Smith added 16 points and 10 rebounds for Atlanta, which had Al Horford and Devin Harris out because of a stomach illness.
The way the Warriors' defense finished was enough to make coach Mark Jackson sick.
Williams made the second of his three consecutive 3s to bring Atlanta within 90-85 with 21.8 seconds left. Curry, who had made a layup over Smith on the previous possession, missed a 3-pointer that Barnes tracked down.
Barnes, drafted seventh overall out of North Carolina, was fouled and made both free throws. He had not had more than 14 points or five rebounds in his first seven games.
Williams made another 3-pointer to slice Golden State's lead to 90-88. Jack, who finished with nine points and four rebounds, was fouled and swished both free throws to secure the victory.
Atlanta has had multiple players get sick during its West Coast trip. The latest bug sidelined Horford and Harris. Zaza Pachulia started at center in Horford's place, and even he had to overcome a setback.
Pachulia was cut above his right eye in the first quarter, with blood dripping down the side of his face. He received stitches in the locker room and returned.
With the Hawks hurting on the inside, the Warriors went to work.
Lee led the charge by going at Atlanta's depleted front line and allowed Golden State to play inside-out.
Golden State withstood several shots from Atlanta before hanging on.
The Hawks started the third quarter on a 7-1 run to trim the Warriors' lead to two. Ivan Johnson then inadvertently elbowed Warriors second-round pick Draymond Green in the face while going for a rebound late in the quarter.
Green stayed down for a couple of minutes until walking gingerly to the locker room, with Johnson patting him on the chest on the way off the court. The team said X-rays on the right side of Green's jaw came back negative. He later returned.
In the meantime, another rookie helped the Warriors create some separation.
Barnes ignited an 18-7 spurt the lasted through the opening minute of the fourth quarter to put Golden State ahead 73-60. He threw down a putback dunk that brought roaring fans to their feet, including Warriors owner Joe Lacob sitting in his usual courtside spot, and mixed in a turnaround jumper and a driving layup.
Atlanta closed within two on Williams' 3-pointer in the final minute but never got closer.
NOTES: The Warriors honored former coach Don Nelson at halftime for his Hall of Fame induction in September. The 72-year-old Nelson, who has an NBA-record 1,335 wins, said he has no plans to get involved in basketball again and is enjoying retirement at his home in Maui, Hawaii. ... The Hawks have added more hand sanitizer in the locker room and separated infected players from others because of the stomach illness that has swept through part of the team. ... Warriors C Andrew Bogut will rehab his surgically repaired left ankle in the Los Angeles area during the team's three-game road trip starting Friday in Minnesota.