The Catalan outfit had paid €1m in March to the Brazilian club to have a preferential option to acquire 70% of the player's sporting rights.
Barca paid the remaining €3.5m to land the player on a five-year contract.
He will represent Barca B next season where he will look to break into the first team.
Maia arrived at Sao Paulo at 14 and was tied to the club until 2022. He won seven titles with Sao Paulo's youth teams and had his best season in 2018-19 when he scored 30 goals in 36 games.
The suspension of football in Brazil in March due to the coronavirus pandemic prevented Maia from making his first team debut.
The versatile attacker, who can play on the left or through the middle, has been capped by Brazil at youth level.
His signing continues Barca's aggressive pursuit of the best young talent from all over the world.
Attacking midfielder Pedri Gonzalez, 17, also joined Barca earlier this month from Las Palmas.
Asked if the coveted Pedri and Trincao would be sold this summer, Barcelona president Josep Maria Bartomeu said they would not be.
"No. They are not and neither are Araujo, Riqui [Puig] or Ansu [Fati]," he added. "We are trying to create a new generation of players. Next season will be different. We have young players arriving to the team like Trincao and Pedri and players promoted from Barca's reserves like Riqui, Ansu and Araujo."