In their 198th league meeting – the most played fixture in the top flight – it was Everton who recorded their 73rd win.
Villa took the lead against the run of play through Leandro Bacuna’s second goal in as many matches.
But the Toffees hit back with two goals in the final 16 minutes of the match.
Substitute Steven Naismith restored parity with a neat finish before Belgium international Mirallas won the game with a brilliant late free-kick.
Villa boss Paul Lambert set his side up with three centre-halves as part of a five-man defence, but the hosts almost breached their backline in their first attack of the game.
Winger Aiden McGeady came inches from making a dream start on his full Toffees debut after rattling the upright with a stunning left-foot curler from just inside the area.
The hosts continued to keep their opponents at arm’s length in a stop-start opening 20 minutes although Villa seemed happy enough to defend deep and counter-attack in numbers when given the opportunity.
McGeady’s tame effort was easily collected by goalkeeper Brad Guzan while at the other end Ron Vlaar fired over from a prodigious distance.
As the rain came teeming down, Villa stunned the hosts to take the lead with their first effort on target after 34 minutes.
Ross Barkley was caught dwindling on the ball by Fabian Delph and Bacuna then set Christian Benteke motoring forward.
The striker slid the ball back to the Dutchman who kept his cool to bury his right-foot drive between Tim Howard’s legs and into the far corner for his first away goal of the season.
It was also Villa’s seventh goal in their last three top-flight matches.
Everton, who had lost just one of their last 20 Premier League games on home soil, came out a more determined side for the second 45 minutes as manager Roberto Martinez sent on playmaker Steven Pienaar for an out of sorts Barkley.
The Toffees were missing a target man and, with their new 6ft 8ins loan striker from Monaco, Lacina Traore, watching the action from the stands, how Martinez would have wished the Ivorian was fully fit for this one.
With the pressure mounting on the West Midlands side, Leon Osman pounced on a loose touch from Ashley Westwood only to see his left-foot skimmer fly past Guzan’s far post.
Karim El Ahmadi, who scored his first Villa goal against Everton, came on after an hour for an ineffective Grant Holt as Lambert looked to shore up his midfield.
South African star Pienaar was becoming more and more influential and he was next to test a busy Guzan with a strike from a tight angle.
With time running out Naismith was sent straight into the action for John Stones and the hosts came close to levelling matters after Benteke’s defensive header from Leighton Baines’ free-kick fell the wrong side of the post from Everton’s point of view.
They were deservedly back on terms after 74 minutes though and both Everton substitutes combined to restore parity much to the relief of the home supporters.
Pienaar’s delicious flick sent Naismith through and the Scotland international cleverly slotted his low right-foot effort beyond Guzan’s outstretched leg for his sixth of the season.
Captain Vlaar was replaced by winger Marc Albrighton as Lambert switched his system to a 4-5-1 for the final few minutes.
However, it was Everton who sealed all three points with five minutes remaining thanks to a sumptuous 30-yard free-kick from the right boot of Mirallas.
The goal helped them leapfrog Tottenham into fifth and maintain their Champions League aspirations.
Villa tried to respond and substitute Albrighton let fly from distance, but his shot was deflected just over and that proved to be the final chance.