We grow 25-nm-thick Mn4N and Co0.2Mn3.8N epitaxial films on SrTiO3(001) by molecular beam epitaxy. These films show the tetragonal structure with a tetragonal axial ratio c/a of approximately 0.99. Their magnetic properties are measured at 300 K, and perpendicular magnetic anisotropy is confirmed in both films. There is a tendency that as the Co composition increases, an anisotropy field increases, whereas saturation magnetization and uniaxial magnetic anisotropy energy decrease. First-principles calculation predicts the existence of tetragonal Mn4N phase. This explains the c/a ∼ 0.99 in the Mn4N films regardless of their film thickness and lattice mismatch with substrates used.