Context. HD 150136 is a triple hierarchical system and a non-thermal radio emitter. It is formed by an O3-3.5 V + O5.5-6 V close binary and a more distant O6.5-7 V tertiary. So far, only the inner orbital properties have been reliably constrained. Aims. To quantitatively understand the non-thermal emission process, accurate knowledge of the physical and orbital properties of the object is crucial. Here, we aim to investigate the orbital properties of the wide system and to constrain the inclinations of the inner and outer binaries, and with these the absolute masses of the system components. Methods. We used the PIONIER combiner at the Very Large Telescope Interferometer to obtain the very first interferometric measurements of HD 150136. We combined the interferometric observations with new and existing high resolution spectroscopic data to derive the orbital solution of the outer companion in the three-dimensional space. Results. The wide system is clearly resolved by PIONIER, with a projected separation on the plane of the sky of about 9 milli-arcsec. The best-fit orbital period, eccentricity, and inclination are 8.2 yr, 0.73 and 108 degr. We constrain the masses of the three stars of the system to 63 +/- 10, 40 +/- 6, and 33 +/- 12 Msun for the O3-3.5 V, O5.5-6 V and O6.5-7 V components. Conclusions. The dynamical masses agree within errors with the evolutionary masses of the components. Future interferometric and spectroscopic monitoring of HD 150136 should allow one to reduce the uncertainties to a few per cent only and to accurately constrain the distance to the system. This makes HD 150136 an ideal system to quantitatively test evolutionary models of high-mass stars as well as the physics of non-thermal processes occurring in O-type systems.