A robust positive association between perceived discrimination and Internet gaming addiction (IGA) among adolescents has been demonstrated by existing research; however, the mediating mechanisms underlying this relationship remain largely unknown. This study, grounded in the cognitive–behavioral and social development models, examined whether deviant peer affiliation and maladaptive cognitions mediated the predictive effect of perceived discrimination on adolescent IGA. Six-hundred-and-sixty students (Meanage = 13.43 years; 367 female participants) recruited from southern China participated in four assessments (fall 7th grade, spring 7th grade, fall 8th grade, spring 8th grade). Participants completed a self-administered questionnaire that assessed their demographics, as well as questionnaire measures of perceived discrimination, deviant peer affiliation, maladaptive cognitions, and IGA. The structural equation model showed that fall 7th grade’s perceived discrimination positively predicted spring 7th grade’s deviant peer affiliation, which, in turn, increased fall 8th grade’s maladaptive cognitions, ultimately increasing spring 8th grade’s IGA. Moreover, the indirect effect of fall 7th grade’s perceived discrimination on spring 8th grade’s IGA via spring 7th grade’s deviant peer affiliation was also significant. The results suggested deviant peer affiliation and maladaptive cognitions as potential mediating mechanisms linking perceived discrimination to adolescent IGA. These findings have important implications for the prevention and intervention of adolescent IGA.