Villa led 2-0 at halftime on goals from Richard Dunne and Darren Bent, prompting near silence from Arsenal fans who are still waiting for a trophy to follow the 2005 FA Cup.
But a revitalized home side got back in the game on Robin van Persie's 54th-minute penalty, then tied it on Theo Walcott's lucky rebound before grabbing the lead seven minutes later on a second spot kick from Van Persie.
Middlesbrough and Sunderland will replay Feb. 7 for the right to face Arsenal after tying their fourth-round match 1-1.
Having avoided a fourth straight defeat, the Gunners are now just three games away from a Wembley final.
"We tried to keep focused and calm," Arsenal manager Arsene Wenger said. "It is an opportunity but you could see today how hard the games are."
Without making any halftime changes, Wenger revived his team at the interval.
"Sometimes we want so hard to attack that sometimes we forget to focus on our defensive task," Wenger said.
Dunne's late challenge on Van Persie gave the Netherlands striker the chance to send goalkeeper Shay Given the wrong way from the spot and Walcott created the opening for a 57th-minute tying goal with some fine control on the goal-line to the right of goal.
But the England winger was lucky to score, with fullback Alan Hutton's attempted clearance hitting Walcott in the face and rebounding over the line from close range.
That didn't prevent Walcott from celebrating effusively on the touchline.
"You need a bit of luck," Walcott said. "Hopefully that luck's changing."
Van Persie put Arsenal in front moments later after the backtracking Bent brought down Laurent Koscielny with a sliding tackle from behind.
Arsenal great Thierry Henry missed a chance late on after coming on in the 89th for the third appearance of his loan from Major League Soccer's New York Red Bulls. But home fans could still cheer the result and the return from injury of France right back Bacary Sagna.
Injuries mean Arsenal has been playing without specialist fullbacks since the start of December but Sagna came on alongside Henry for his first appearance since October.
Second-tier Middlesbrough led against its local rival when Barry Robson capitalized on some weak defending to smash a 16th-minute volley across goalkeeper Simon Mignolet and in at the far post.
Sunderland manager Martin O'Neill introduced striker Fraizer Campbell at halftime for his first appearance since August 2010. And he stroked in a low shot 14 minutes later following a mistake by Robson.
Campbell had not played for the first team for 500 days because of knee injuries.
"I was delighted to be back out there," Campbell said. "You can't put it into words. It was a tough 18 months for myself, but days like this are what I've been waiting for and hopefully now I can stay injury-free and just do what I do."
Crawley Town, the lowest-ranked side left in this season's FA Cup, was handed a meeting with Premier League club Stoke in Sunday's fifth-round tie.
While third-tier Stevenage will host eight-time champion Tottenham in the last 16, League Two Crawley will host last season's finalist on the weekend of Feb. 18-19.
Liverpool's reward for a 2-1 fourth-round win over traditional rival Manchester United is another home match, this time against a Brighton side that knocked out Premier League club Newcastle on Saturday.
Chelsea will host Birmingham, Norwich plays Leicester, Everton will face either Blackpool or Sheffield Wednesday, and Bolton will go to the winner of the replay between Millwall and Southampton.