Luuk de Jong scored the winning goal with a header at the back post in the first half from Oscar Mingueza’s cross.
Xavi’s side, who were without a number of first team players because of Covid and injuries, dominated for large periods but were often frustrated.
De Jong was the main threat, hitting the woodwork twice in the first half, including once with a bicycle kick.
Mallorca pushed for an equalizer late on when Dani Rodriguez’s teasing ball was headed inches over the bar by Fer Nino, before Marc-Andre ter Stegen was forced into a smart save to deny Jaume Costa.
But the hosts, sitting 15th in the table, were unable to keep out Barcelona, who have closed the gap on fourth-placed rivals Atletico Madrid.
Barcelona were missing 17 players in total, including regulars Dani Alves, Ousmane Dembele, Jordi Alba, Philippe Coutinho, Gavi and Serginho Dest.
Earlier this week, Xavi said it was “crazy” that La Liga were allowing the game to go ahead given the state of the teams’ respective squads.
But his young players, with an average age of 24 years and 201 days, managed to get the job done.
Ahead of kick-off, former Mallorca and Barcelona star Samuel Eto’o made a guest appearance.
A mural of Eto’o was unveiled outside the Estadi de Son Moix and he was applauded by both sets of fans in the stadium.