We carried out x-ray absorption spectroscopy (XAS) and x-ray magnetic circular dichroism (XMCD) spectroscopy and investigated cation valence states and spin and orbital magnetic moments in the inverse-spinel ferrimagnet Ni$_{1-x}$Co$_{2+y}$O$_{4-z}$ (NCO) epitaxial films with the perpendicular magnetic anisotropy. We show that the oxygen pressure P$_{O2}$ during the film growth by pulsed laser deposition influences not only the cation stoichiometry (site-occupation) but also the cation valence state. Our XAS results show that the Ni in the O$_{h}$-site is in the intermediate valence state between +2 and +3, Ni$^{(2+delta)+}$ (0<$delta$<1), whose nominal valence state (the $delta$ value) varies depending on P$_{O2}$. On the other hand, the Co in the octahedral (O$_{h}$) and tetrahedral (T$_{d}$) sites respectively have the valence state close to +3 and +2. We also find that the XMCD signals originate mainly from the T$_{d}$-site Co$^{2+}$ (Co$_{Td}$) and O$_{h}$-site Ni$^{(2+delta)+}$ (Ni$_{Oh}$), indicating that these cation valence states are the key in determining the magnetic and transport properties of NCO films. Interestingly, the valence state of Ni$^{(2+delta)+}$ that gives rise to the XMCD signal remains unchanged independent of P$_{O2}$. The electronic structure of Ni$^{(2+delta)+}$ that is responsible for the magnetic moment and electrical conduction differs from those of Ni$^{2+}$ and Ni$^{3+}$. In addition, the orbital magnetic moment originating from Co$_{Td}$ is as large as 0.14 $mu_{B}/Co_{Td}$ and parallel to the magnetization while the Ni$_{Oh}$ orbital moment is as small as 0.07 $mu_{B}/Ni_{Oh}$ and is rather isotropic. The Co$_{Td}$ therefore plays the key role in the perpendicular magnetic anisotropy of the films. Our results demonstrate the significance of the site-dependent cations valence states for the magnetic and transport properties of NCO films.