The Catalan hosts took the lead when Borja Garcia rifled home from 12 yards before Sergio Ramos equalised with a penalty after Marco Asensio was fouled.
Real edged ahead through another penalty won by Asensio – this time taken by Karim Benzema – before Bale’s composed finish from Isco’s pass.
Bale turned provider to set up Benzema to make it 4-1 from close range.
The 29-year-old Wales forward also scored in Real’s first La Liga game under Julen Lopetegui last week – a 2-0 win over Getafe at the Bernabeu Stadium.
And there were signs of another surprise when Garcia finished well after Real’s defence had allowed him too much space.
There were few complaints about either penalty – Marc Muniesa guilty of lunging into Asensio before Pere Pons’ badly timed challenge on Real’s number 20.
Bale provided the goal of the match after Isco’s lovely pass before Benzema sealed the points 10 minutes from time.