We present secure [NII[ detections in two mm-bright, strongly lensed objects at high redshift, APM08279+5255 (z=3.911) and MM18423+5938 (z=3.930), using the IRAM Plateau de Bure Interferometer. Due to its ionization energy [NII] is a good tracer of the ionized gas phase in the interstellar medium. The measured fluxes are S([NII])=(4.8+/-0.8) Jy km/s and (7.4+/-0.5) Jy km/s respectively, yielding line luminosities of L([NII]) =(1.8+/-0.3) x 10^9 \mu^{-1} Lsun for APM08279+5255 and L([NII]) =(2.8+/-0.2) x 10^9 \mu^{-1} Lsun for MM18423+5938. Our high-resolution map of the [NII] and 1 mm continuum emission in MM18423+5938 clearly resolves an Einstein ring in this source, and reveals a velocity gradient in the dynamics of the ionized gas. A comparison of these maps with high-resolution EVLA CO observations enables us to perform the first spatially-resolved study of the dust continuum-to-molecular gas surface brightness (Sigma_{FIR} Sigma_{CO}^N, which can be interpreted as the star formation law) in a high-redshift object. We find a steep relation (N=1.4+/-0.2), consistent with a starbursting environment. We measure a [NII]/FIR luminosity ratio in APM0828+5255 and MM18423+5938 of 9.0 x 10^{-6} and 5.8 x 10^{-6}, respectively. This is in agreement with the decrease of the [NII]/FIR ratio at high FIR luminosities observed in local galaxies.