Two of the Premier League's early frontrunners looked set to cancel each other out in a competitive encounter in which chances were at a premium, as debutant defender Wesley Fofana impressed for the hosts.
Timothy Castagne was at the heart of Leicester's best work early on before Villa's Matt Targett sent a free-kick wide before half-time.
Esri Konsa put a header narrowly wide for the Villans nine minutes after the break as the visitors' threat increased.
Soon after substitute Bertrand Traore sent a header straight at Kasper Schmeichel, Villa burst forward again in stoppage time and Barkley's crisp shot found the bottom corner.
The win sends Villa second, on 12 points and one point behind leaders Everton, while Leicester are fourth on nine points.
Budweiser King of the Match: Emiliano Martínez
Leicester: 25 Oct v Arsenal (A)
Aston Villa: 23 Oct v Leeds (H)