Five minutes into added time Ritchie De Laet forced Matt Ingram in the Chairboys' goal to parry into the path of St Ledger who kept his cool to score from close range.
Jo Kuffour had earlier equalised for the home side after Dave Nugent had opened the scoring from the penalty spot in the first half for the Championship outfit.
Nugent tucked home the penalty in the 14th minute after Chairboys skipper Stuart Lewis felled an on-rushing Andy King in the area.
But the hosts, who in 2001 famously beat Leicester in the FA Cup quarter-finals, almost equalised through Dean Morgan's left-footed drive before Kuffour turned on the edge of the box to rasp home in the 21st minute.
Ingram pulled off superb stops from Neil Danns and Lloyd Dyer after the restart as the Foxes began to grow into the game.
And in the 68th minute the visitors nearly found their breakthrough but Chris Wood fired wide leaving St Ledger to spare their blushes late on.