Substitute Berenguer curled a left-footed shot past Thibaut Courtois in the 89th minute at San Mames to finally provide reward for Athletic, who had dominated the match without being able to make an breakthrough.
Madrid went into the tie missing injured top scorer Karim Benzema and without a recognised left-back, with Ferland Mendy, Marcelo and Miguel Gutierrez all absent. Carlo Ancelotti opted for David Alaba on the left, and picked a front three of Vinicius Junior, Rodrygo Goes and Marco Asensio.
The team's bus was met by a hostile reception on its way into the stadium, with bottles being thrown, smashing one of the bus windows; Athletic later apologised for the incident.
Athletic started well, as Courtois saved two-handed from Dani Garcia's powerful long-range shot. Iker Muniain fired into the side netting after beating Casemiro inside the box, and a last-ditch challenge from Eder Militao was needed to prevent Nico Williams getting in on goal.
With seconds remaining in normal time, substitute Berenguer stepped inside Nacho before shooting past Courtois to see Athletic into the semi finals.