Nitriding is a well-known thermochemical treatment improving the surface hardness and the wear resistance of steel. The phase composition and growth kinetics of the nitrided layer can be controlled using a gas nitriding with changeable nitriding potential. In this work, such a gas nitriding was used to produce, on 42CrMo4 steel, the two nitrided layers differing in the thickness of compound zone and diffusion zone. The microstructure and nanohardness of these layers were studied. For the first time, the tribological behavior of gas nitrided layers at elevated temperatures (from 23 to 400 °C) was investigated. The compound zone consisted of ε + (ε + γ’) iron nitrides and, in the diffusion zone, the nitric sorbite with γ’ precipitates was observed. The highest nanohardness was measured in the ε + γ’ zone. The lowest values of friction coefficients were obtained if the contact surface of the friction pair entered the ε + γ’ zone. After the wear process, at a final temperature of 400 °C, worn surfaces showed only intensive abrasive wear, evidenced by shallow grooves. The increased oxygen content at the edges of wear tracks indicated possible oxidative wear.