Context : Aims : Molecular line emission from high-redshift galaxies holds great promise for the study of galaxy formation and evolution . Methods : The weak signals can only be detected with the largest mm-wave telescopes , such as the IRAM interferometer . Results : We report the detection of the J = 5–4 line of HNC and the tentative detection of the N= 4–3 line of CN in the quasar APM 08279+5255 at z = 3.9 . These are the 4 ^ { th } and 5 ^ { th } molecular species detected at such a high redshift . The derived HNC and CN line intensities are 0.6 and 0.4 times that of HCN J= 5–4 . If HNC and HCN are co-spatial and if their J= 5–4 lines are collisionally excited , the [ HNC ] / [ HCN ] abundance ratio must be equal to 0.6 within a factor of 2 , similar to its value in the cold Galactic clouds and much larger than in the hot molecular gas associated with Galactic HII regions . It is possible , however , that fluorescent infrared radiation plays an important role in the excitation of HNC and HCN . Conclusions :