City were pushed all the way and only a last-gasp strike from James Milner completed their passage after the England international cancelled out Atdhe Nuhiu’s opener.
Pellegrini said: “I’m relieved because I don’t think we played very well today.
“We didn’t expect it to be easy and when you go behind to a side from the Championship, they make it hard for you and they played very well.
“Apart from the last 20 minutes, we played very badly because we didn't press well, we didn't have good movement and we didn’t make any chances while Sheffield Wednesday had just one opportunity from which they scored.
“We tried to change things in the final half-hour and found another gear and with Yaya Toure, James Milner, Samir Nasri and David Silva all on the pitch, we began to find space and finally create chances.”