Food processing environments contaminated with E. coli O157:H7 and forming biofilms will be a continuous source of contamination, leading to foodborne illness and food spoilage. Now, the main countermeasure is chemical disinfectants, but the use of disinfectants may cause the development of drug-resistant bacteria and other negative effects. Therefore, there is an urgent need to find novel antimicrobial agents. Quorum-sensing inhibitors (QSI) are a promising strategy to control biofilm formation. This study aimed to screen the optimal QSI of E. coli O157:H7 from plant-derived small molecules by biofilm and QS inhibitory activities and to validate their effectiveness in combination with disinfectants. In addition, the inhibition mechanism of gallic acid on biofilm formation was further explored. Gallic acid was screened as the QSI of E. coli O157:H7, and its AI-2 inhibitory activity against LuxS/AI-2 QS system reached 95.54% and 98.89% after treatment with 1/2 MIC gallic acid for 4 h and 6 h, respectively. It inhibited biofilm formation by affecting flagellar assembly, chemotaxis, and expression of adhesion factor-related genes, which interfered with the transition of bacteria from reversible to irreversible adhesion. In beef broth simulation system, the inhibition rate was greater than 90.00% in all gallic acid and benzalkonium chloride combination groups. Therefore, gallic acid can be a potential antimicrobial synergist in the food industry, combined with disinfectants to control E. coli O157:H7 biofilms while avoiding the development of resistance.