Palace had won just one of their opening 11 games this season but took an early lead when Ismaila Sarr raced on to Jean-Philippe Mateta's pass and slotted past Emiliano Martinez.
Villa began to grow into the game and equalised 30 minutes later through Ollie Watkins, who rounded Dean Henderson and passed into an empty net to end his five-game goal drought.
Unai Emery's side were buoyed by the goal and were soon awarded a penalty when Will Hughes fouled Leon Bailey, but Youri Tielemans' spot-kick was superbly saved by Henderson.
Palace retook the lead almost immediately when 21-year-old Justin Devenny, making his second senior appearance for the club, converted Sarr's cross to finish a swift counter-attack.
Henderson and Maxence Lacroix produced several key interventions to preserve the away side's lead, but neither could do anything to stop Ross Barkley heading in from a corner with just over 10 minutes left.
The game became end-to-end in the closing stages with Martinez making a fine save to deny Palace substitute Jeffrey Schlupp.
#aston_villa