Currently, drugs are limited to treating pediatric pneumonia in clinical practice. It is urgent to find one new precise prevention and control therapy. The dynamically changing biomarkers during the development of pediatric pneumonia could help diagnose this disease, determine its severity, assess the risk of future events, and guide its treatment. Dexamethasone has been recognized as an effective agent with anti-inflammatory activity. However, its mechanisms against pediatric pneumonia remain unclear. In this study, spatial metabolomics was used to reveal the potential and characteristics of dexamethasone. Specifically, bioinformatics was first applied to find the critical biomarkers of differential expression in pediatric pneumonia. Subsequently, Desorption Electrospray Ionization mass spectrometry imaging-based metabolomics screened the differential metabolites affected by dexamethasone. Then, a gene-metabolite interaction network was built to mark functional correlation pathways for exploring integrated information and core biomarkers related to the pathogenesis and etiology of pediatric pneumonia. Further, these were validated by molecular biology and targeted metabolomics. As a result, genes of Cluster of Differentiation19, Fc fragment of IgG receptor IIb, Cluster of Differentiation 22, B-cell linker, Cluster of Differentiation 79B and metabolites of Triethanolamine, Lysophosphatidylcholine(18:1(9Z)), Phosphatidylcholine(16:0/16:0), phosphatidylethanolamine(O-18:1(1Z)/20:4(5Z,8Z,11Z,14Z)) were identified as the critical biomarkers in pediatric pneumonia. B cell receptor signaling pathway and glycerophospholipid metabolism were integrally analyzed as the main pathways of these biomarkers. The above data were illustrated using a Lipopolysaccharides-induced lung injury juvenile rat model. This work will provide evidence for the precise treatment of pediatric pneumonia.