Gabriel Agbonlahor took the tie to extra time and added a second after Charles N'Zogbia had put Villa ahead for the first time.
Lambert, in his first season at Villa Park having taken over in the summer, was delighted with the performance.
"It is a massive result for us. I thought the way we played was excellent," he said.
"It was a brilliant response from the team. It was a huge effort.
"We didn't deserve to go a goal behind but we showed real character to come back."