The tissue structure of fresh-cut lettuce is easy to be damaged during processing and transportation, which leads to the reduction of its edible quality and safety. Ultra-high-performance liquid chromatography (UHPLC) combined with time-of-flight tandem mass spectrometry (TMS) metabolomics was used to identify the differential metabolites related to the antibacterial activity in lettuce and explore their bacteriostatic mechanism. The experimental results revealed that the growth of Escherichia coli was quite different when different varieties of lettuce were used as the nutrient substrate. Between the varieties Beizisheng No. 3 (BZ3) and Shooter 101 (SS), 204 differential metabolites showed significant changes (P < 0.05), 86 metabolites showed changes between the varieties BZ3 and Beisansheng No. 1 (BS1). Among the metabolites, isoquercitrin was the upregulated differential metabolite in BZ3 compared to SS and BS1. The content of isoquercitrin in lettuce juice positively correlated with the antibacterial activity of polyphenol extract, but negatively correlated with the growth of E. coli. The bacteriostatic property of polyphenol extract destroys the morphological structure of E. coli. The higher the isoquercitrin content, the stronger the resistance of fresh-cut lettuce to E. coli.