The veteran Rossoblu forward punished two dreadful defensive errors from the home side in the first half before Robert Acquafresca sealed a superb win with his late strike
The Nerazzurri, who went into the game without a win in their four previous Serie A outings, had the better of the early exchanges but they were left reeling after a quick-fire double from Di Vaio shortly before the break, the veteran forward punishing dreadful defensive errors from the hosts.
Inter tried to rally in the second period but Robert Acquafresca sealed victory for the Rossoblu when he fired home with just five minutes of normal time remaining.
Shorn of the services of Diego Milito through injury, Nerazzurri boss Ranieri opted to recall Giampaolo Pazzini up front and deploy Diego Forlan in a three-pronged attacking unit just in behind the former Sampdoria striker.
Wesley Sneijder initially looked right at home in the 4-2-3-1 system, the Dutchman turning sharply away from Daniele Portanova some 25 metres out before curling a shot straight into the arms of Jean-Francois Gillet.
The Netherlands international then presented Maicon with two gilt-edged headed opportunities to open the scoring.
In the first instance, on 19 minutes, the Brazilian was denied by a wonderful instinctive save from Gillet after finding himself completely unmarked on the edge of the six-yard box.
Then, just before the half-hour mark, Maicon nodded wide after getting on the end of another terrific cross from the right from Sneijder.
Inter were cranking up the pressure and Forlan should have done better when he found himself in on goal on 32 minutes but the Uruguay international's first touch was poor and his subsequent low strike was blocked by Gillet’s left boot.
The goal was coming. Unfortunately for Inter, it came completely against the run of play.
Lucio naively allowed himself to be rolled by Alessandro Diamanti just inside the area and the ball eventually found its way to Diego Perez, who calmly played in Di Vaio.
The veteran striker still had much to do but he dummied his way inside Yuto Nagatomo before beating Julio Cesar with a cool finish.
Incredibly, the Bologna number nine repeated the trick just over 60 seconds later after pouncing on another dreadful error at the back from Inter, with Andrea Ranocchia the culprit this time, the young centre-back displaying a complete lack of awareness in electing to chest the ball down for himself when he clearly had no idea where Di Vaio was as the former Juventus man pounced.
Inter continued to battle but they repeatedly left themselves open to the counterattack in the second half and Di Vaio very nearly completed his hat-trick six minutes after the restart but his deflected effort whistled just wide of the left upright.
The Nerazzurri had no option but continue pressing, though, and the ineffective Forlan squandered a golden opening to halve the home side’s arrears on the hour but he shot weakly at Gillet after a stirring surge down the left flank by Nagatomo.
Ranocchia then nearly went some way towards atoning for his earlier error but his header from Sneijder’s free-kick was brilliantly tipped around the post by Bologna’s Belgian shot stopper.
By that point, Ranieri must have known it was not going to be his side's night and Bologna put the game beyond the hosts when Acquafresca slotted home from the edge of area after taking on a retreating Inter defence.
The loss, coupled with Napoli's victory at Fiorentina, results in Inter dropping to sixth in the standings, while Bologna climb one place to 16th.
How do you stay up to date with football when on the move? With http://m.goal.com – your best source for mobile coverage of the beautiful game.