The recent availability of ESOs high-resolution spectrograph CRIRES offers now the opportunity to study numerous spectral features in the near-IR in intermediate-mass main-sequence and pre-main-sequence stars. High-resolution CRIRES spectra were obtained in three spectral regions, two regions around 1mu and one region around 1.57mu containing magnetically sensitive Fe I lines. The largest number of near-IR spectral features was detected and identified in the well-studied magnetic Ap star gamma Equ. Nearly 30% of the spectral lines in the Ap star HD154708, with one of the strongest magnetic fields known among the Ap stars of the order of 25kG, remain unidentified due to a lack of atomic data. Only very few lines belonging to the rare earth element group have been identified in both Ap stars. A number of spectral lines including the Ce III and Dy II lines appear magnetically split due to the presence of a strong magnetic field in their atmospheres. Variable behaviour of lines of the elements He, N, Mg, Si, and Fe over the rotation period in the spectra of HD101412 confirm our previous finding of variability in the optical region. Due to the very fast rotation of 51Oph, only a few spectral lines have been identified with certainty.