Masia won after having a gigantic crash at the morning warm-up using Sergio Garcia, which forced the latter to skip the race.
The 18-year-old needed a scrappy start from pole position even though he was part of this huge lead group, he spent the majority of their race out the best five.
He started the final lap, when Darryn Binder (CIP) was at the lead, only fifth, but gained three rankings over the rear straight to perform instant supporting Gabriel Rodrigo (Gresini) at Flip 5.
The Bester Capital Dubai rider then made a strong move two turns later, and held off the charge of Rodrigo in the past over taking area of this track at Turn 1 3 to take his inaugural success in Moto 3.
Rodrigo tried to retake the effect on the outside line of the corner however ended up being pushed wide by Binder.
Younger brother of Moto2 riders Brad Binder, Darryn secured his best result at second, with Snipers riders Tony Arbolino also observing his maiden podium in the third.
Local hero Rodrigo at the finish also dropped behind Niccolo Antonelli (SIC58 Squadra Corse) along with Ayumu Sasaki (Petronas Sprinta).
Lorenzo Dalla Porta (Leopard) was well-placed to triumph as he directed just two of their previous four laps however in the long run the Italian was shuffled back to seventh, followed by fellow Italian Dennis Foggia (Sky VR46).
Toba narrowly escaped freaking out when he was included in a episode between John McPhee (Petronas Sprinta) and Alonso Lopez (EG0,0), nevertheless the Japanese rider was the sole one of those three to four carry on.
Pruestl duo Jakub Kornfeil and Filip Salac crashed in the early stages, Can Oncu and Kazuki Masaki possibly dropped at Flip 1, while Vicente Perez needed a high side at Flip 1 3.