We report the detection in emission of various highly excited rotational transitions of HNC (J = 6-5 through J =12-11) toward the carbon-star envelope IRC +10 216 using the HIFI instrument on-board the Herschel Space Observatory. Observations of the J = 1-0 and J = 3-2 lines of HNC with the IRAM 30-m telescope are also presented. The lines observed with HIFI have upper level energies corresponding to temperatures between 90 and 340 degrees Kelvin, and trace a warm and smaller circumstellar region than that seen in the interferometric maps of the J = 1-0 transition, whose emission extends up to a radius of 20". After a detailed chemical and radiative transfer modeling, we find that the presence of HNC in the circumstellar envelope of IRC +10 216 is consistent with formation from the precursor ion HCNH+, which in turn is produced through several proton transfer reactions which are triggered by the cosmic-ray ionization. We also find that the radiative pumping through 21 um photons to the first excited state of the bending mode v2 plays a crucial role to populate the high-J HNC levels involved in the transitions observed with HIFI. Emission in these high-J rotational transitions of HNC is expected to be strong in regions which are warm and dense and/or have an intense infrared flux at wavelengths around 21 um.