Sean St Ledger fired home from close range in the fifth minute of stoppage time to put the Championship side into the next round.
Jo Kuffour's superb strike drew the home side level before half-time after David Nugent's penalty had put the visitors in front.
And despite the cruel nature of the defeat, Ainsworth had only good things to say about his battling troops.
"It was a cruel blow but I feel like a winner," he said.
"The way we performed, approached the game and stood up to a Premier League-contending team was outstanding.
"Every supporter who sang their hearts out should go home proud because I certainly am. The players are going to need lifting but they gave me everything they had and then some as well.
"I can see a good future from these last two performances, I want to bring the good times back to Wycombe Wanderers.
"They are tired more than deflated, I think some of the Leicester players said to our lot during the game that they will do well in League Two.
"To have confidence like that from your peers who have played Championship and Premier League level just shows you that Wycombe are not walkovers any more, certainly not under me."