Swindon took the lead after 30 minutes.
Goalkeeper Danny Free parried an effort from Lloyd Macklin's effort but Sam Morris tapped home the rebound.
The Reds drew level on 53 minutes though when Jamil Adams hit a great strike into the corner, but it was not to be as Ben Joyce raced through to send Swindon into the Fourth Round.
Teams:
SWINDON TOWN: Scott, Evans, Tozer, Morrison, Kennedy, Macklin, Morris, Hammonds, Everiss, Joyce, Hyde.
Subs: Wallington, Taylor, Thompson, Winter, Willmoth.
BARNSLEY: Free, Devonshire, Waterfall, White, Smith, Adam, Jennings, Butterfield, Fedorenko, Warbuton, Watts.
Subs: Taylor, Branson, Crapper, Briscoe, Grundy.