Monochamus alternatus Hope (Coleoptera: Cerambycidae), an invasive beetle that has caused billions of dollars in economic losses, is a serious pest of Pinus massoniana in many Asian countries. Clarifying the eye pigment gene and its knockdown phenotype of M. alternatus can provide functional gene identification and a marker for screening of gene editing, as well as help develop new control ideas. In this study, we first screened the transcriptome and found one homologous gene of tryptophan 2,3-dioxygenase (TDO) and one of kynurenine-3-monooxygenase (KMO). By measuring the expression levels of TDO and KMO in different developmental periods, it was indicated that TDO and KMO were expressed in various stages of M. alternatus. The gene expression of MaKMO was higher than MaTDO, showing high expression after pupation and decreasing at the beginning of eclosion. MaTDO and MaKMO were knocked down using RNA interference technology in different periods of expression, and the temporal expression changes were obtained using RT-qPCR technology. The results showed that the expressions of MaTDO and MaKMO were significantly inhibited by the injection of dsRNA; the expressions of MaTDO at 48 h, 96 h and after pupation were 21.9%, 32.3% and 59.2%, respectively, meanwhile, those of KMO were 23.4%, 25.0% and 69.7%, respectively. There was a significant change in eye color, and the beetles were able to pupate normally without their activity being affected. Therefore, both MaTDO and MaKMO can be used as tag genes for M. alternatus. A dominant marker system based on eye color can be developed for the genetic manipulation and control of M. alternatus.