Innovation output within a team is nurtured by the combination of team members’ diverse knowledge in the context of collaborative teamwork. Most previous research has assumed a linear, interactive effect of knowledge diversity and network structure in predicting team innovation. However, more recent research suggests that the relationship among knowledge diversity, network structure, and team innovation is a multifaceted and dynamic issue. A critical question remains: How does the interaction of high or low knowledge diversity with high or low network density contribute to team innovation? To address this question, we adopted the perspective of 'knowledge networks' and conducted a machine-learning inductive method to examine the interactive effect of knowledge diversity and network density on team innovation. We gathered multisource data from 2,202 teams within a large high-technology firm in China spanning from 2014 to 2017. The results indicate that knowledge diversity and network density exhibit a curvilinear interactive effect on team innovation. The two factors reinforce each other in the initial stage and reach the optimum outcome at a moderate level. However, beyond this threshold, the two factors start restraining each other. This study deepens our understanding of the paradoxical joint effects of knowledge diversity and network density on team innovation.