Ter Stegen suffered the injury while claiming a corner two minutes into the second half after two goals from Robert Lewandowski had put Barca ahead, and Ayoze Perez pulled one back for the home side.
Pablo Torre added Barca's third just before the hour, with Raphinha adding two more in the 74th and 83rd minutes.
Atletico Madrid dropped points with a 1-1 draw away to Rayo Vallecano in which they again punched below their summer spending, reports Xinhua.
Isi Palazon put Rayo ahead with an excellent goal with Conor Gallagher leveling for Atletico after the break to further increase his status at the club.
Athletic Bilbao move up to third with a 3-1 win at home to Celta, which gives them their third triumph in a week.
Gorka Guruzeta's fourth-minute flick put Athletic ahead, but Iago Aspas leveled from the penalty spot in the 25th minute.
Guruzeta's second of the game put Athletic back ahead after 39 minutes before Alvaro Djalo's first goal for the club sealed the win 10 minutes from time.
Earlier in the day, Getafe and Leganes drew the south-Madrid derby 1-1 with Borja Mayoral's 83rd-minute penalty for the home side, canceling out Jorge Saenz's goal for Leganes seven minutes earlier.
On Saturday, Vinicius Jr helped Real Madrid notch a 4-1 win at home to Espanyol.
Thibaut Courtois deflected a low cross into his own net in the 54th minute to give Espanyol the lead, but some poor defending allowed Dani Carvajal to tap in the equalizer four minutes later.
Vinicius sent over a pinpoint cross for Rodrygo to score Madrid's second goal in the 75th minute and added a third three minutes later as Espanyol gave the ball away cheaply in midfield.
Kylian Mbappe scored a penalty in the last minute after Endrick had been pulled back to net Madrid's fourth.