The 20-year-old rider made his MotoGP debut this year with the GasGas-branded Tech3 satellite squad, riding a factory RC16 with KTM-supplied engineers.
Espargaro edged past Ducati's Bagnaia by 0.031 seconds to claim pole position while championship leader Jorge Martin lines up seventh on the grid following a crash late in Q2.