But Bournemouth equalised in first-half stoppage time when City goalkeeper Bentley went to catch a left-wing cross from Junior Stanislav on his goalline and fumbled the ball into the net for an embarrassing own goal.
Carter-Vickers' 88th-minute goal had a touch of fortune about it as a far-post header from substitute Phil Billing appeared to ricochet in off his back.
The win put Bournemouth back in the Championship top six and they were just about worth the points in a close match.
The visitors began brightly and defender Lloyd Kelly might have netted twice against his old club in the opening eight minutes.
First he fired high over the bar from a Stanislas pass and then saw a better shot deflected just wide by the fingertips of Bentley, who also had to save from Jefferson Lerma.
Diedhiou saw a 19th-minute shot deflected for a corner from City's first meaningful attack before Asmir Begovic kept his side on terms with a double save four minutes later.
After diving to parry Bakinson's low drive, the Bournemouth keeper recovered brilliantly to smother Diedhiou's follow-up effort.
City had grown into the game and went close again after 31 minutes when Kasey Palmer curled a low effort inches wide from the edge of the box. Bakinson supplied the pass and was causing problems breaking from midfield.
His goal emphasised that. Wells had switched to the right flank and City were on top when Bentley's error made it 1-1.
The home side lost Hunt to injury early in the second half and Pearson sent on midfielder Henri Lansbury, moving Vyner to right-back.
It was a tighter game than in the first period, with neither side able to create clear openings. Both teams made attacking changes, with Woodgate sending on Shane Long and Pearson introducing Antoine Semenyo.
Dominic Solanke shot over for Bournemouth under pressure from City skipper Tomas Kalas as the visitors finished strongly, taking the points thanks to Carter-Vickers' late intervention.