Nicky Maynard, who was subject to three bids from Leicester over the summer, put his side in front with a free kick.
The striker had the chance to put the West Country team two goals up before the break from the penalty spot, but his shot hit the crossbar.
The home side drew level on 56 minutes when David Nugent hit home from outside of the area.
The Robins were back in front 10 minutes later when Maynard slotted home from the edge of the box.
Bristol City host Portsmouth on Saturday, while Leicester City take the short trip to local rivals Nottingham Forest.