Cardiff had the better of the first half as Josh Murphy struck a post while Sean Morrison had a header cleared off the line.
But Burnley took the lead against the run of play on 51 minutes when Ashley Westwood crossed for Johann Berg Gudmundsson to head past Neil Etheridge at the back post.
Cardiff drew level nine minutes later when Bruno Ecuele Manga's cutback was finished superbly by Murphy.
However, with 20 minutes to go, Burnley regained the lead as Vokes headed in Gudmundsson's cross to move Burnley up to 12th.
Defeat leaves Cardiff, still without a win, in 19th on two points.
Cardiff: 6 Oct v Spurs (A)
Burnley: 6 Oct v Huddersfield (H)