Due to the inherent limitations of metals, such as their poor performance at high temperatures caused by thermo-oxidation and expansion, carbon nanotube yarns (CNTFs) have emerged as promising alternatives because of their high electrical conductivity and thermal stability. Doping of CNTFs has been widely studied because it significantly increases electrical conductivity through a simple process. Despite these advantages, doped CNTFs are not suitable for extreme environments, especially high temperatures. This is due to the weak interaction between dopants and CNTFs, along with the low thermal stability of the dopants themselves, leading to dopant decomposition and oxidation at high temperatures. Herein, we present doped CNTFs that are covalently functionalized with a nitrogen compound composed of imide and nitro groups, which are renowned for good thermal stability. The electron-withdrawing effect of this nitrogen compound polarizes the CNTFs to a positive charge, inducing p-type doping effects and enhancing electrical conductivity from 2989 to 4008 S cm−1. The strong covalent bonding between the nitrogen compound and CNTFs, along with the thermal stability of the dopants, ensures that the electrical conductivity of our doped CNTFs is maintained even after annealing at 300 °C for 12 h. Our proposed doped CNTFs offer a guideline for expanding the practical applications of doped CNTFs to a wider range of high-temperature environments.