Context. Single-dish observations of molecular tracers have suggested that both star formation and an AGN can drive the gas chemistry of the central ∼kpc of active galaxies. The irradiation by UV photons from an starburst or by X-rays from an AGN is expected to produce different signatures in molecular chemistry, which existing data on low-J lines cannot distinguish, as they do not trace gas at high temperature and density. Depending on the angular scale of a galaxy, the observed low-J lines can be dominated by the emission coming from the starburst ring rather than from the central region. Aims. With the incorporation of high-J molecular lines, we aim to constrain the physical conditions of the dense gas in the central region of the Seyfert 2 galaxy NGC 1068 and to determine signatures of the AGN or the starburst contribution. Methods. We used the James Clerk Maxwell Telescope to observe the J = 4−3 transition of HCN, HNC, and HCO + , as well as the CN N J = 2 5/2 − 1 3/2 and N J = 3 5/2 − 2 5/2 , in NGC 1068. We estimate the excitation conditions of HCN, HNC, and CN, based on the line intensity ratios and radiative transfer models. We discuss the results in the context of models of irradiation of the molecular gas by UV light and X-rays. Results. A first-order estimate leads to starburst contribution factors of 0.58 and 0.56 for the CN and HCN J = 1−0 lines, respectively. We find that the bulk emission of HCN, HNC, CN, and the high-J HCO + emerge from dense gas (n(H 2 ) ≥ 10 5 cm −3 ). However, the low-J HCO + lines (dominating the HCO + column density) trace less dense (n(H 2 ) < 10 5 cm −3 ) and colder (T K ≤ 20 K) gas, whereas the high-J HCO + emerges from warmer (>30 K) gas than the other molecules. We also find that the HNC/HCN and CN/HCN line intensity ratios decrease with increasing rotational quantum number J.