Elche took a surprise lead at the Martinez Valero when Fidel capitalised on a Pedri error on the stroke of half-time but Barca came storming back thanks to two substitutes. Ferran Torres diverted in from close range on the hour before Depay scored an 84th-minute penalty after the striker had drawn Elche's Antonio Barragan into a handball.
Victory sends Barca two points above Real Betis and three clear of Atletico Madrid in the table, before Betis and Atletico face each other in a crucial battle for the top four later on Sunday.
It also continues an impressive run of form for Xavi Hernandez's side, who have not lost in the league since December and came into this game on the back of scoring four times in three consecutive games for the first time since 2017.