Brentford looked set to follow up the scalp of Everton in the previous round with another giant-killing when Sam Wood broke the deadlock midway through the second half.
But veteran striker Kevin Phillips levelled in the second minute of injury time and, after extra-time had failed to resolve the tie, City came out on top 4-3 on penalties.
McLeish said: "Brentford were superb, well organised and battled. I thought we were out the cup.
"But, when you have the hunger and desire to keep going right to the end, I have to salute the players.
"We put together three or four passes together for the first time for the goal. We lacked creativity and imagination before that."