Investigation of dynamic changes in friction behavior of ultrananocrystalline diamond (UNCD) films is a complex mainly because of the rapid change in chemical composition at the sliding interfaces. To address this issue, for the first time, we report chemical phase analysis of transferfilm using the depth-resolved X-ray photoelectron spectroscopy (XPS) technique. The friction coefficient of the UNCD films was high during the initial run-in regime, but it gradually decreased to an ultralow value after longer sliding cycles at the ambient atmospheric tribo-condition. Depth-resolved XPS analysis showed a higher sp(3)/sp(2) carbon ratio during the initial run-in regime. This ratio decreased with increasing sliding cycles and consequently the friction coefficient decreased. However, a higher value of the friction coefficient throughout the run-in regime persisted at the high-vacuum tribo-condition. In this case, the sp(3)/sp(2) carbon ratio inside the transferfilm was quite high and no considerable changes were observed in the depth-resolved XPS analysis. This investigation confirmed that the dynamic friction behavior in UNCD films was manipulated by the sp(3)/sp(2) carbon ratio inside the transferfilm which showed tribo-atmospheric dependence.