Microbiologically influenced corrosion (MIC) accounts for a large proportion of industrial steel corrosion, among which the most representative microorganism is sulfatereducing bacteria (SRB). The direct application of the fungicides may cause high utilization dosage, increased bacterial resistance, and environmental pollution and cannot realize the effective longlasting antimicrobial and corrosion inhibition performance. Herein, a novel kind of nanocapsule with both bactericidal and corrosion inhibition functions is developed. The hollow mesoporous silica (HMSNs) is used as the carrier and encapsulated with benzotriazole (BTA) inhibitors; their surface microchannels are sealed with the bactericide metronidazole (MNZ)-loaded ZIF-8 nanovalve. The high-performance liquid chromatography results confirm that the encapsulation amounts of MNZ and BTA in the nanocapsules are 7.67% and 4.20%, respectively. Moreover, the as-prepared BTA-HMSN/ZIF-8-MNZ nanocapsules exhibit a typical sulfide ion-responsive characteristic. The release rate of the encapsulated MNZ and BTA rises with the increased sulfide-ion concentrations, and the cumulative release amount reaches 80% after 24 h when the sulfide-ion concentration attains 2 mM. Furthermore, the antimicrobial performance of BTA-HMSN/ZIF-8-MNZ nanocapsules is evaluated in SRB solutions. The survival SRB amounts decrease evidently with the increased nanocapsule concentration, and the antibacterial efficiency is nearly 100% at a concentration of 250 μg•mL −1 . The weight loss test and surface analysis also confirm the excellent corrosion inhibition ability of the BTA-HMSN/ZIF-8-MNZ nanocapsules to Q235 steels, whose inhibition efficiency is up to 89.23% after 8 h of immersion in a corrosive environment after the addition of 12 mg•mL −1 of BTA-HMSN/ZIF-8-MNZ nanocapsules. Meanwhile, the Q235 steel maintains a smooth and uniform surface with the protection of BTA-HMSN/ZIF-8-MNZ nanocapsules. Overall, the combination of MNZ bactericides and BTA corrosion inhibitors greatly strengthens the antimicrobial and corrosion inhibition performance of the nanocapsules, and this kind of intelligent sulfide ion-responsive protective system also provides insights for retarding MIC in a complex corrosive environment.