Context. Accretion is a fundamental process in star formation. Although the time evolution of accretion remains a matter of debate, observations and modelling studies suggest that episodic outbursts of strong accretion may dominate the formation of the central protostar. Observing young stellar objects during these elevated accretion states is crucial to understanding the origin of unsteady accretion. Aims. Z CMa is a pre-main-sequence binary system composed of an embedded Herbig Be star, undergoing photometric outbursts, and a FU Orionis star. This system therefore provides a unique opportunity to study unsteady accretion processes. The Herbig Be component recently underwent its largest optical photometric outburst detected so far. We aim to constrain the origin of this outburst by studying the emission region of the HI Br γ line, a powerful tracer of accretion/ejection processes on the AU-scale in young stars. Methods. Using the AMBER/VLTI instrument at spectral resolutions of 1500 and 12 000, we performed spatially and spectrally resolved interferometric observations of the hot gas emitting across the Br γ emission line, during and after the outburst. From the visibilities and differential phases, we derive characteristic sizes for the Br γ emission and spectro-astrometric measurements across the line, with respect to the continuum. Results. We find that the line profile, the astrometric signal, and the visibilities are inconsistent with the signature of either a Keplerian disk or infall of matter. They are, instead, evidence of a bipolar wind, maybe partly seen through a disk hole inside the dust sublimation radius. The disappearance of the Br γ emission line after the outburst suggests that the outburst is related to a period of strong mass loss rather than a change of the extinction along the line of sight. Conclusions. Apart from the photometric increase of the system, the main consequence of the outburst is to trigger a massive bipolar outflow from the Herbig Be component. Based on these conclusions, we speculate that the origin of the outburst is an event of enhanced mass accretion, similar to those occuring in EX Ors and FU Ors.