A dull first half was followed by Andy Najar heading Anderlecht into a 71st-minute lead in Belgium on Wednesday.
Arsenal dug deep though, and levelled through Kieran Gibbs in the 89th minute, before Lukas Podolski sealed all three points in dramatic fashion.
Podolski's 91st-minute winner - which came after Chancel Mbemba Mangulu could not clear Alexis Sanchez's cut-back - gave Wenger the ideal 65th birthday present and he was delighted afterwards.
"We kept going and scored two good goals," Wenger said.
"We had the spirit. It was vital for us to have the chance to qualify.
"We are in a strong position now because Galatasaray and Anderlecht have only one point.
"It's down to us to win our home games and we are through."
Arsenal sit second in Group D with six points - three behind Borussia Dortmund.
Left-back Gibbs said the win was 'massive' for Arsenal as they moved a step closer to the competition's last 16.
"Credit to the boys. We didn't give up," Gibbs said.
"It wasn’t easy to come here but we kept going and it was difficult but we have got the result we wanted. It's a massive result for us."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.