Mastitis is an important infirmity that affects dairy goats and sheep flocks. Antimicrobials are widely used in mastitis therapy; however, the phenomenon of bacterial resistance has sparked interest in therapeutic alternatives, especially the research on essential oils from several plant species. Therefore, this study aimed to evaluate the antimicrobial activity of essential oils against pathogens of importance in caprine and ovine mastitis. The essential oils were obtained by hydrodistillation and the chemical composition was analyzed by gas chromatography coupled to mass spectrometry (GC-MS). The minimum inhibitory concentration (MIC) and minimum bactericidal concentration (MBC) tests were performed to evaluate the antimicrobial activity of the essential oils (EO) of four plants. Fifteen bacterial isolates, previously identified as Staphylococcus spp. and Staphylococcus aureus, were used. The following plant species were used against the 15 bacterial isolates: Lippia origanoides “alecrim pimenta,” Lippia alba “erva cidreira,” Cymbopogon citratus “capim-santo,” and Ocimum basilicum “manjericão.” The first three essential oils presented antimicrobial activity against 100% of the isolates (15/15), with MICs of 560 µg mL-1, 1,173 µg mL-1, and 1,280 µg mL-1, and MBCs of 613 µg mL-1, 1,226 µg mL-1, and 1,333 µg mL-1, respectively. Nevertheless, the essential oil of O. basilicum, which was also tested, exerted no activity against any of the isolates. Carvacrol, citral, geraniol, and estragole were some of the major compounds found. These results can aid other studies that aim to use these essential oils as potential products for subsequent use in the treatment of mastitis in small ruminants.