Ranieri started his tenure at the San Siro with a 3-1 Serie A defeat of Bologna and followed up with another victory over Leonid Slutsky's side in the Luzhniki Stadium.
Lucio gave Inter a sixth-minute lead and Giampaolo Pazzini doubled the lead midway through the first half, before Alan Dzagoev and Vagner Love levelled the scores.
However, substitute Mauro Zarate blasted in the winner 11 minutes from time to get Inter's Group B campaign up and running after the shock home defeat at the hands of Trabzonspor on matchday one.
After Pazzini and the home side's Eugeni Aldonin had tried their luck from distance without success in the early stages, Lucio stunned the home crowd when he opened the scoring from close range.
Diego Milito had an effort saved by goalkeeper Vladimir Gabulov in the 13th minute - but 10 minutes later Inter did have their second goal when Pazzini tapped in Yuto Nagatomo's cross from the right.
The home side sought a way back into the game and after half an hour Inter keeper Julio Cesar tipped a Dzagoev effort from 18 yards over the bar.
Ricardo Alvarez had a shot blocked by Vasili Berezutsky in the 34th minute, with Javier Zanetti shooting over soon after, before the lively Dzagoev tried an overhead kick at the other end - but the effort flew over the bar.
After Pazzini had shot wide in the 39th minute, Vagner Love was off target for the home side from long range.
However, CSKA got the goal they needed three minutes into first half injury-time. Walter Samuel fouled Sekou Oliseh and Dzagoev's curling free-kick found a way over the wall and past Cesar from 20 yards.
Zarate, who replaced Pazzini four minutes after the restart, saw a 56th minute shot tipped around the post by Gabulov - but should have done better six minutes later when he shot low and weakly at the keeper.
CSKA, who came back from 2-0 down to draw in Lille on matchday one, were level in the 77th minute through Vagner Love, who powered into the area and beat Cesar with a powerful low shot.
However, Zarate won it two minutes later when he chested down Esteban Cambiasso's ball and found the bottom corner of the net with a low shot from just inside the penalty area which gave Gabulov no chance.