The left-back fired home after collecting a Jack Grealish pass as Dean Smith’s claimed a barely deserved victory against opponents who played for nearly an hour a man down following Aaron Mooy’s first-half dismissal.
Adam Webster had earlier put the Seagulls in front when he headed home unmarked at a free-kick.
Conor Hourihane then saw a goal chalked off by VAR before Grealish did level, though a point looked like all Villa would collect before the late drama.
Targett’s goal led to wild celebrations inside Villa Park and home fans went home in joyous mood.
For much of the afternoon the chief feeling was one of frustration, as their team laboured against both 11 and 10 men.
Brighton impressed with their passing and took a deserved lead when Webster headed home in the 21st minute, even though the free-kick from which the goal looked wrongly-awarded.
Mooy’s dismissal with 10 minutes remaining of the first-half changed the momentum and though Villa controversially saw a goal ruled out by VAR for the second home game running, Grealish levelled in stoppage time.
But the second half performance was a huge disappointment and the narrative looked again like being their failure to take advantage against 10 men before Targett struck late.
Smith’s men had failed to take advantage when playing against 10-men in games against West Ham and Arsenal last month.
Villa have now won back-to-back Premier League games for the first time since May, 2015 and they are now up to 11th in the table.
It was the visitors who suffered the first moment of alarm when goalkeeper Mat Ryan spilled a Frederic Guilbert cross at the near post.
The ball fell to Wesley near the byline but the striker, with the angle tight, could only scuff it back into the middle where Martin Montoya cleared.
Otherwise, Brighton looked assured. Aaron Connolly missed a good chance when he skied over from 12 yards out but the visitors were well worth their goal when it arrived, even if the circumstances were a little controversial.
There was certainly nothing wrong with the finish, Webster arriving late at the far post and supplying a fine headed finish to Mooy’s free-kick.
Villa’s complaint concerned the award of the set-piece itself, with Hourihane even picking up a booking for what appeared a perfectly-timed challenge on Montoya.
The Republic of Ireland international almost made instant revenge with a free-kick Ryan did well to claw away.
But it was Brighton who looked the better team and Tom Heaton twice prevented the visitors extending their lead.
Villa’s keeper was first sent sprawling to his left to keep out a powerfully struck Maupay effort, before racing out to deny Connolly with his legs after the teenage striker had been put through on goal.
The turning point came 10 minutes before half-time. Mooy, booked only a few minutes before for failing to retreat at a free-kick, slid in foolishly and brought down Grealish to earn a second yellow card.
Hourihane again brought a good save out of Ryan with the free-kick and Villa spent the next period of the game camped in the visitors half before the former thought he had brought them level.
Grealish rolled the ball back for Hourihane to lash a powerful drive into the roof of the net and the teams were lined up to kick-off again before VAR chalked off the goal, Wesley deemed to have obstructed keeper Ryan in the build-up.
Boos were still echoing around the ground when Grealish did bring Villa level in the second minute of stoppage time.
The skipper stabbed home Frederic Guilbert’s low cross from close range, with the cheer which greeted the subsequent kick-off even louder than that which greeted the goal itself.
Villa started the second half in search of another and Hourihane almost provided it, only to see his shot saved at point blank range by Ryan, with Anwar El Ghazi ballooning the inviting rebound over.
Brighton were coping well with 10 men and still looking a threat on the counter.
Maupay sent one shot over the bar from outside the box, before Montoya scuffed a golden chance straight at Heaton following good work from the former.
Villa just could not find any rhythm and their struggles in the final third were summed up when McGinn drove well over the bar from the edge of the box.
There seemed no way through until with 10 seconds remaining in stoppage time, Grealish slipped in Targett who sent his shot over Ryan to spark pandemonium.
21 - GOAL - Brighton take the lead as Adam Webster arrives unmarked at the far post to head home Aaron Mooy’s free-kick. Villa are unhappy as Conor Hourihane appeared to clearly win the ball when challenging Martin Montoya.
35 - RED CARD Brighton’s Aaron Mooy is dismissed for a second bookable offence after fouling Jack Grealish.
42 - GOAL DISALLOWED Villa think they have levelled when Conor Hourihane fires high into the net but after a lengthy delay the goal is disallowed for a foul by Wesley on Brighton keepr Mat Ryan in the build-up.
45+2 GOAL Villa have the ball in the net again and this one will stand. Skipper Jack Grealish slides in to stab home Frederic Guilbert’s low cross.
90+4 GOAL Matt Targett steals the points for Villa, firing home after latching onto Grealish’s pass.
Villa (4-3-3):Heaton, Guilbert, Engels, Mings, Targett, McGinn, Nakamba, Hourihane (Trezeguet 63), El Ghazi (Luiz 76), Wesley (Davis 76), Grealish Subs not used: Konsa, Taylor, Lansbury, Steer (gk).
Brighton (4-4-2): Ryan, Montoya (Duffy 70), Webster, Dunk, Burn, Gross, Propper, Stephens, Mooy, Maupay (Alzate 81), Connolly (March HT) Subs not used: Bissouma, Trossard, Murray, Button (gk).