A simple, sensitive, and exact methyl esterification in combination with gas chromatography-mass spectrometry (GC-MS) method was developed to determine the contents of palmitic acid and stearic acid in the chlorinated butyl rubber stoppers and liposome injections in order to evaluate the compatibility of pharmaceutical packaging materials. In this experiment, palmitic acid and stearic acid were detected in the form of methyl hexadecanoate and methyl stearate in chlorinated butyl rubber stoppers and liposome injections. The results showed good linearities in the range of 0.50–10.00 µg·mL−1 for methyl hexadecanoate and 1.00–20.00 µg·mL−1 for methyl stearate, with the limits of detection (LOD) 11.94 ng·mL−1 and 11.90 ng·mL−1, respectively. The recoveries that ranged from 95.25% to 100.29% were satisfied, and the relative standard deviation (RSD) was no more than 7.16%. The developed method was successfully applied to evaluate the compatibility of chlorinated butyl rubber stoppers with liposome injections and the safety assessment.