The aim of this study was to explore the effect of temperature on tuberculosis (TB) incidence using the distributed lag non-linear model (DLNM) from 2017 to 2021 in Kashgar city, the region with higher TB incidence than national levels, and assist public health prevention and control measures. From January 2017 to December 2021, a total of 8730 cases of TB were reported, with the higher incidence of male than that of female. When temperature was below 1 °C, it was significantly correlated with TB incidence compared to the median observed temperature (15 °C) at lag 7, 14, and 21, and lower temperatures showed larger RR (relative risk) values. High temperature produced a protective effect on TB transmission, and higher temperature from 16 to 31 °C has lower RR. In discussion stratified by gender, the maximum RRs were achieved for both male group and female group at − 15 °C with lag 21, reporting 4.28 and 2.02, respectively. At high temperature (higher than 20 °C), the RR value of developing TB for female group was significantly larger than 1. In discussion stratified by age, the maximum RRs were achieved for all age groups (≤ 35, 36–64, ≥ 65) at − 15 °C with lag 21, reporting 3.20, 2.07, and 3.45, respectively. When the temperature was higher than 20 °C, the RR of the 36–64-year-old group and the ≥ 65-year-old group was significantly larger than 1 at lag 21, while significantly smaller than 1 for cumulative RR at lag 21, reporting 0.11, 95% confidence interval (CI) (0.01, 0.83) and 0.06, 95% CI (0.01, 0.44), respectively. In conclusion, low temperature, especially in extreme level, acts as a high-risk factor inducing TB transmission in Kashgar city. Males exhibit a significantly higher RR of developing TB at low temperature than female, as well as the elderly group in contrast to the young or middle-aged groups. High temperature has a protective effect on TB transmission in the total population, but female and middle-aged and elderly groups are also required to be alert to the delayed RR induced by it.