The hosts led 1-0 at the break in Tuesday night’s Sky Bet Championship clash following an own goal by Bluebirds captain Sean Morrison.
But they failed to build on that lead, with James Chester rattling the crossbar from a 50th-minute corner.
- Firmino, Salah double as Liverpool hit seven in Palace demolition
- Kaduna residents protest ‘outrageous’ electricity billings, want prepaid meters
Vokes then missed a golden chance to put Stoke firmly in control when his penalty was saved by Alex Smithies nine minutes later.
It proved to be a pivotal turning point with Robert Glatzel levelling following a smart finish.
And the Welsh side hit the front when Morrison made amends by heading home the winner from a Joe Ralls corner with 14 minutes to go.
Joe Bursik came 30 yards off his line to beat Kieffer Moore to a long ball over the top after five minutes as Cardiff enjoyed a good start.
Tyrese Campbell curled the ball wide from the edge of the box after Joe Bennett gave away possession cheaply.
Campbell had shouts for a penalty waved away after he went down under a sliding challenge from Morrison.
Liverpool loanee Harry Wilson drilled a powerful effort just over from distance in the 21st minute.
Morrison turned a low Campbell cross into his own net from a yard out to give Stoke a 25th-minute lead.
It signalled a lull in action with the visitors unable to find much of a response against a hardworking and well-organised Stoke side.
Campbell went down inside the box following a collision with Bennett after 37 minutes.
Wilson wasted a good headed chance at the angle of the six-yard box after Sheyi Ojo teed him up four minutes later.
Chester thundered a header against the crossbar from James McClean’s corner five minutes after the interval.
But the half struggled to find its flow following separate injury breaks to treat Wilson and Campbell, which saw both players eventually replaced.
Morrison’s nightmare night continued after he conceded a penalty for a soft push on Nick Powell.
But Vokes could not take advantage after Smithies guessed the right way in the 59th minute.
And Cardiff hit back as substitute Glatzel levelled at the back post after getting on the end of a Ralls cross just seven minutes after entering the action.
And Morrison headed the winner for Cardiff from six yards after he found space from a corner.