The Reds were cruising with a two-goal lead at the break after Raheem Sterling and Daniel Sturridge scored before Notts hit back with two goals of their own through Yoann Arquin and Adam Coombes to force the game to extra-time.
Sturridge and Jordan Henderson then added two more goals for the home side to progress to the third round with the overall result pleasing manager Brendan Rodgers who admits it was a very tricky night for his club.
"It was a real interesting game because we were so in control in the first half and at the beginning of the second half," he told Sky Sports.
"I think I can only give plaudits to two groups really. One is my players because with ten men and being pegged back to two each, to show that character and commitment and fight to want to get through, it's a big credit to them.
"I think you have to give a big credit to Notts County because at 2-0 down here at Anfield, we're in good form at the minute. It was a great fightback for them and that will bode well for their season because they showed great character and quality.
"We've seen it in football before - 2-0 is always a dangerous scoreline no matter who you're against. We're obviously disappointed with the goals we conceded and our management of the game, but across the board, we're glad to get through."