This paper makes a multi-group analysis with gender as a grouping variable through a structural equation model and analyzes the intermediary chain role of political knowledge, political participation, and political efficacy between social media and government trust of the youth groups in Beijing. Results show that social media directly affects young females' political participation and does not directly impact young males' political participation. In both groups, political knowledge and political participation have a mediating chain role in social media and government trust. These results implicate that the government should pay attention to the development of social media, make good use of the indirect effect of social media on youths' government trust, focus on promoting correct and healthy political knowledge on social media, cultivate youth political consciousness, create more opportunities for youth political participation, and let the youth understand the significance of political activities, so as to improve their government trust.