Both sides had suffered shock defeats last weekend, with Zinedine Zidane's side then beaten 3-2 at home by Shakhtar Donetsk in their Champions League opener on Wednesday night.
Sergio Ramos put Real Madrid back in front from the penalty spot on 63 minutes, which was awarded after the referee reviewed a shirt pull on the pitchside monitor, before substitute Luka Modric added a third in stoppage time.
Real Madrid – showing five changes from the team which lost in Europe on Wednesday night as captain Ramos returned from injury – swept into the lead after just five minutes when Karim Benzema played in Valverde, who drove the ball into the far corner.
Barcelona, though, were soon level in the eighth minute as Alba got away down the left and pulled the ball back across for teenager Fati to slot home from six yards – breaking the record as the youngest El Clasico goalscorer.
On 24 minutes, Lionel Messi brushed off Ramos and drove a low strike towards the near post, which Thibaut Courtois pushed away before a swift Real Madrid counter saw Benzema fire straight at Barcelona keeper Neto.
At the start of the second half, Ramos headed wide from a corner before 17-year-old Fati almost grabbed another goal after being picked out by Messi, but dragged his shot wide after cutting back inside.
Los Blancos went back in front after 63 minutes.
Ramos tumbled following a tug by Clement Lenglet, and the referee awarded a penalty having reviewed the incident on the pitchside monitor. The Real Madrid captain made no mistake from the spot.
Koeman sent on Antoine Griezmann, Ousmane Dembele and Francisco Trincao for the closing stages
Neto saved from Vinicius Junior as Real pushed for a third, before at the other end Dembele sent a chip over the crossbar.
Real Madrid sealed victory when substitute Modric finished off from close range after Neto had denied Vinicius Junior again.
Zidane's men move two points clear of Real Sociedad, while Barcelona are 10th following a second straight LaLiga defeat.