Boro bossed the first half and deservedly led at the break but the visitors took complete control after half-time.
Boro started brightly and created the first chance after three minutes as Grant Leadbitter flicked on into the box for Lukas Jutkiewicz to curl just wide of the near post.
Then they won a free-kick 25 yards out but Leadbitter's effort dipped over the wall and straight into the keeper's hands.
Leicester centre-back Zak Whitbread was hurt in a collision with Jonathan Woodgate attacking a corner in the Boro box and after lengthy treatment he was stretchered off after 18 minutes with Liam Moore coming on.
Leicester had a good spell and Boro were forced to make some timely tackles to keep them at bay.
The visitors had their first real chance after 33 minutes when they won a free-kick 25 yards out and Chris Wood drilled in a low 25-yard effort that keeper Jason Steele went full length to save.
But Boro broke out to take the lead after 35 minutes as Mustapha Carayol curled a cross to the near post and Riverside old boy Sean St Ledger, under pressure from Jutkiewicz, got a glancing header at the near post that squeezed in for an own goal.
Boro went close twice before the break as first Jutkiewicz then Carayol cut into the box to have low angled efforts saved by Kasper Schmeichel.
They could have gone further ahead stoppage time as Marvin Emnes danced into the box, rounded a defender and drew the keeper out but as he checked inside to shoot, team-mate Leadbitter arrived to hammer in an effort that Schmeichel did well to get back and block.
After the break it was a different story as Leicester grabbed control of the game from the off.
Jamie Vardy chased a long ball forward into the box but Steele dashed off his line to save at the striker's feet.
Leicester had a penalty appeal after 55 minutes as a Wood chip towards goal was cleared weakly by Williams and as the ball rolled free, Boro's Dean Whitehead barged Danny Drinkwater aside to clear but the referee waved play on.
And after a strong spell of pressure Leicester levelled on the hour with Drinkwater slamming a sizzling 20-yard drive through a crowded box and into the top corner.
Leicester got a second goal after 67 minutes as David Nugent peeled to the left and slotted a neat ball forward for Vardy to race clear of Williams and get into the box before lifting it past the advancing Steele.
Boro almost pulled one back quickly as a corner fell to Whitehead 12 yards out but his half-volley flew just over the bar.
Leicester should have had a third after 78 minutes as Ritchie De Laet sent Nugent down the right and as Boro's defence stood rooted the striker wandered into the box to crack a low angled shot that Steele did well to block at the near post.
And the Foxes went close again after 87 minutes as Drinkwater sent Vardy racing forward to drill in a low shot that Steele pushed onto the post.