In their first game since Ranieri was sacked last week by the club’s Thai owners, Jamie Vardy scored twice for last season’s struggling champions.
Danny Drinkwater also netted with a superb long-range strike.
It helped propel Leicester out of the relegation places and up to 15th, two points above the drop zone with 12 games remaining.
Vardy scored 24 league goals last season but the England international’s goals in either half were just his sixth and seventh of this campaign.
Ranieri was dismissed nine months after masterminding one of the biggest sporting shocks of all time by leading the 5,000-1 outsider to league glory.
But Leicester has failed to replicate that form. Before facing Liverpool, it had won just five league games. Five consecutive league defeats sent it spiralling down the standings.
The host, with Ranieri’s assistant, Craig Shakespeare,min interim charge, made a bright start with Shinji Okazaki forcing Liverpool goalkeeper Simon Mignolet into an early diving save.
Center back Robert Huth wastefully headed over from a corner, and Mignolet blocked Vardy’s volley as Leicester showed plenty of attacking intent.
The home side’s pressure was rewarded when a through ball from Marc Albrighton sent Vardy away on goal and last season’s leading scorer calmly slotted past Mignolet to give Leicester the lead after 28 minutes.
Just 11 minutes later, Leicester fans were on their feet again to acclaim an outstanding goal from Drinkwater, the midfielder sending a dipping volley past Mignolet from fully 30 meters.
Vardy got his second on the hour when he headed in a Christian Fuchs cross and, although Liverpool enjoyed its best spell after Philippe Coutinho pulled a goal back in the 68th, Leicester held firm.
Liverpool remained in fifth place but has only one league win this year.
Help our journalists uncover the facts
In times like these InDaily provides valuable, local independent journalism in South Australia. As a news organisation it offers an alternative to The Advertiser, a different voice and a closer look at what is happening in our city and state for free. Any contribution to help fund our work is appreciated. Please click below to donate to InDaily.