The Championship hosts took an early lead when Mads Bech Sorensen poked home and could have furthered the score-line before half-time.
But the Foxes came out firing in the second-half as Cengiz Under equalised 49 seconds after the restart.
Youri Tielemans was tripped in the box and converted the resulting penalty five minutes later.
James Maddison then capped off an excellent performance with a late goal.
Brendan Rodgers' side will face Brighton in the fifth-round.
"I thought the performance throughout the game was very good," Rodgers said. "We started well but gave away a cheap goal.
"The rhythm and flow of our game in the second half was exceptional. It's a very good win. Brentford really tested us.
"We've got goals in the team, players playing with a high level of confidence. There were other moments where we could have scored more.
"If we want to challenge and want to win things, we have to go deep into competitions. I'm very happy with the physicality of the players from that point of view."