Mohamed Salah headed in Coutinho’s cross at the far post to give Liverpool a 15th-minute lead.
The Brazilian curled in a superb free-kick for his first goal of the season to make it 2-0 but Shinji Okazaki halved the deficit on the stroke of half-time, poking in a loose ball from a corner.
Jordan Henderson restored Liverpool’s two-goal lead, but within 90 seconds Leicester hit back, Jamie Vardy nodding in after Demarai Gray’s shot had been saved.
It could have been 3-3 on 73 minutes but Simon Mignolet repelled Vardy’s penalty after the Liverpool goalkeeper had brought the striker down.
Liverpool’s first win in three league matches lifts them to fifth, while Leicester drop to 16th.