Background Little is known about the relationship between sleep quality and lung cancer incidence. Thus, this study was conducted to investigate the potential connection between sleep quality and lung cancer incidence. Methods We performed and selected a nested case–control study that included 150 lung cancer cases and 150 matched controls based on the Lianyungang cohort. Univariate and multivariate logistic regression was utilized to investigate the connection between potential risk factors and lung cancer incidence risk. Results In this study, the average age of participants was 66.5 ± 9.1 years, with 58.7% being male, and 52.7% reportedly experiencing sleep quality problems. The results of multivariate logistic regression showed that poor sleep quality was connected to an increased lung cancer incidence risk (P = 0.033, odds ratio = 1.83, 95% confidence interval = [1.05–3.19]) compared with those with good sleep quality. The stratified analyses showed a significantly positive connection between poor sleep quality (vs. good sleep quality) and cancer risk in smokers (vs. non-smoker, P for interaction = 0.085). The combined effect analysis indicated that smokers with poor sleep quality suffered from a 2.79-fold increase in cancer incidence rates when compared with non-smokers with good sleep quality. Conclusions Poor sleep quality was positively connected to an increased lung cancer incidence risk. In addition, among those individuals with poor sleep quality, smoking increased the lung cancer incidence risk.