The Welsh side trailed to Edin Dzeko's long-range strike after the break.
But Aron Gunnarsson equalised and two Fraizer Campbell headers secured a thrilling victory for the hosts.
Protecting a lead
Manchester City only lost once after leading in the Premier League throughout the whole of the last campaign but have won only one of their four away games against newly promoted sides since the start of last season.
"The worst thing is that we got ahead. After we scored I thought it would be easier but two corners decided the game," Pellegrini said.
"It was a pity. I did not expect to lose. We didn't play well but they played with 10 players near their box so it was very difficult to score."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.