Giampaolo Pazzini put the visitors in front in the 39th minute, before Alessandro Diamanti levelled with a penalty in the 66th minute.
Archimede Morleo was sent off after giving away a penalty in the 81st minute, from which Diego Milito put Inter back in front, and Lucio rounded off the scoring three minutes from time as Inter picked up their first three points of the season at the fourth attempt.
There was a different air about Inter following this week's change in coach and they had the chance to go ahead after only eight minutes when Diego Forlan's free-kick was cleared badly by Mikael Antonsson to Walter Samuel, who failed to beat Jean-Francois Gillet from five yards.
Three minutes later, Marco Di Vaio failed to convert a one-on-one chance against Julio Cesar as he looked to curl his shot into the top corner but sent it a yard high and a yard wide.
Forlan's 25-yard strike cannoned against the outside of the right post minutes later before Philippe Coutinho shot just wide in a lively opening.
Inter took the lead in the 39th minute with an excellent team move involving Forlan and Esteban Cambiasso, who set up Pazzini for a low shot which Gillet got his hand to but could not prevent creeping in.
Cambiasso hit the crossbar in the 50th minute before Julio Cesar scrambled across his goal to deny Di Vaio at the other end of a very open encounter.
Julio Cesar then made another excellent save to push Gaston Ramirez's direct free-kick behind for a corner, from which Samuel was adjudged to have fouled Daniele Portanova inside the area and a penalty was given.
Diamanti stepped up to score his first goal for the club and bring Bologna level.
A penalty at the other end saw Milito restore Inter's lead after he had been fouled by Morleo, who was shown the red card.
Lucio put the result beyond doubt with a near-post header from Sulley Muntari's free-kick in the 87th minute to give Ranieri a winning start to life in charge of the Nerazzurri.