UV ice photodesorption is an important non-thermal desorption pathway in many interstellar environments that has been invoked to explain observations of cold molecules in disks, clouds and cloud cores. Systematic laboratory studies of the photodesorption rates, between 7 and 14 eV, from CO:N2 binary ices, have been performed at the DESIRS vacuum UV beamline of the synchrotron facility SOLEIL. The photodesorption spectral analysis demonstrates that the photodesorption process is indirect, i.e. the desorption is induced by a photon absorption in sub-surface molecular layers, while only surface molecules are actually desorbing. The photodesorption spectra of CO and N2 in binary ices therefore depend on the absorption spectra of the dominant species in the subsurface ice layer, which implies that the photodesorption efficiency and energy dependence are dramatically different for mixed and layered ices compared to pure ices. In particular, a thin (1-2 ML) N2 ice layer on top of CO will effectively quench CO photodesorption, while enhancing N2 photodesorption by a factors of a few (compared to the pure ices) when the ice is exposed to a typical dark cloud UV field, which may help to explain the different distributions of CO and N2H+ in molecular cloud cores. This indirect photodesorption mechanism may also explain observations of small amounts of complex organics in cold interstellar environments.