There was only one minute of normal time left when substitute Peter Crouch pounced to score from the Villa's only serious second half attack.
The Villains had been forced onto the defensive after the second half dismissal of Nolberto Solano, but the brilliance of goalkeeper Thomas Sorensen had denied the home side.
Middlesbrough were seeking a double following a 2-0 November win at Villa Park, while the visitors were chasing the fourth spot in the Premier League.
A minute's silence was immaculately observed before the kick-off in memory of three former Middlesbrough players, including ex-England skipper George Hardwick.
Hardwick, a local legend, who captained Great Britain against the Rest of Europe in 1947, died earlier in the week after a long illness.
Villa showed an attacking policy from the kick-off. There was no question that David O'Leary's men would defend and rely on the counter attack, as they were the more dangerous side in the early stages as Boro struggled to get into their stride.
Australian international goalkeeper Mark Schwarzer was busier than his Villa counterpart in the opening stages, yet Middlesbrough could have snatched the lead with their best move to date in the 28th minute.
Gaizka Mendieta found Massimo Maccarone with a quick pass inside the penalty area. The speed of the movement caught out Villa but Sorensen saved the day.
Boro stepped up the tempo and only a superb Sorensen save denied George Boateng. The former Villa midfield player hit a shot of tremendous power but the Danish international pushed the ball over the bar.
Five minutes before the break Joseph-Desire Job put Middlesbrough ahead with an unstoppable shot. Mendieta supplied the pass and Job let fly with a magnificent strike into the far corner of the net. It was a 'pick that out' type of shot and Sorensen was left completely helpless.
Just when it looked as though Middlesbrough would go into the break with a one-goal lead Villa struck back. Thomas Hitzlsperger fired over a free-kick from the right and the home side paid for slack marking when the unchallenged Gareth Barry headed home.
Eight minutes into the second half Barry limped off with a leg injury and was replaced by Peter Whittingham. If this was a blow to Villa, worse was to follow when Solano was shown the red card by referee Graham Barber.
After a touchline tussle with Boateng, the Peruvian foolishly hit Boateng in the face with a right hander. The Dutchman collapsed on the touchline and required treatment as Solano made the long walk back to the tunnel.
The Villa fans clearly thought Boateng had made a meal of the incident and had collapsed in dramatic style. They jeered Boateng everytime he touched the ball after the incident, but Barber had no alternative but to dismiss Solano.
At this stage it was a devastating blow to Villa, for Solano had been an inspiration in their improved form following his move from Newcastle United.
Middlesbrough, understandably, piled on the pressure against their ten-man opponents, while Villa were forced onto the defensive and looked dispirited.
Boro, however, failed to take advantage of their chances and were denied on other occasions by Sorensen, causing manager Steve McClaren to withdraw full-backs Danny Mills and Franck Queudrue in the closing minutes - an attacking move.
A goal arrived but to the despair of the home fans it was a sucker punch.
With what could be described as their first serious attack after the interval Villa snatched a valuable three points.
When Schwarzer dived to his right to push out a Ulises de la Cruz shot Crouch pounced at the far post to shoot into an empty net with the goalkeeper still on the ground.
Crouch, who had only been on the field 15 minutes as a replacement for Juan Pablo Angel, was immediately mobbed by his team-mates.
The Boro players looked a little shell-shocked as they trudged off the pitch while the jubilant winners did a victory jig in front of their fans.
Newcastle United manager Sir Bobby Robson was among the VIPs in the directors box. Robson must have been as disappointed as Middlesbrough fans because the result was a blow to United's hopes of a lucrative Champions League spot.
Middlesbrough boss McClaren was bitterly disappointed. "The result was cruel. But you get that now and again in football," he said.
"We just could not score and their goalkeeper kept well and they got their blocks in, and in the last minute we were done by a sucker punch."Asked to comment on the Boateng incident, McClaren replied: "I did not see it. It happened way over on the far side of the pitch."
Man of the Match: Thomas Sorensen - Peter Crouch grabbed the vital late goal but Villa's goalkeeper was the real match-winning hero.