Millimeter observations of pre- and protostellar cores show that the abundances of the gas-phase tracer molecules, C18O and N2H+, anticorrelate with each other and often exhibit 'holes' where the density is greatest. These results are reasonably reproduced by astrochemical models, provided that the ratio between the binding energies of N2 and CO, RBE, is taken to be between 0.5 and 0.75. This Letter is the first experimental report of the desorption of CO and N2 from layered and mixed ices at temperatures relevant to dense cores, studied under ultrahigh vacuum laboratory conditions using temperature programmed desorption. From control experiments with pure ices, RBE=0.923±0.003, given Eb(N2-N2)=790±25 K and Eb(CO-CO)=855±25 K. In mixed (CO:N2=1:1) and layered (CO above or below N2) ice systems, both molecules become mobile within the ice matrix at temperatures as low as 20 K and appear miscible. Consequently, although a fraction of the deposited N2 desorbs at lower temperatures than CO, up to 50% of the N2 molecules leave the surface as the CO itself desorbs, a process not included in existing gas-grain models. This codesorption suggests that for a fraction of the frozen-out molecules, RBE is unity. The relative difference between the CO and N2 binding energies as derived from these experiments is therefore significantly less than that currently adopted in astrochemical models.