Medicinal drugs can cross-react with gut bacterial proteins, but the identification of these off-target interactions is difficult. Multi-omic approaches enabled the discovery of a bacterial peptidase that is inhibited by diabetic drugs and unexpectedly influences bacterial fitness within complex microbial communities via a non-proteolytic mechanism.