Selective inhibitors of gut bacterial β-glucuronidases (GUSs) are of particular interest in the prevention of xenobiotic-induced toxicities. This study reports the first structure-activity relationships on potency and selectivity of several iminocyclitols (2-7) for the GUSs. Complex structures of Ruminococcus gnavus GUS with 2-7 explained how charge, conformation, and substituent of iminocyclitols affect their potency and selectivity. N1 of uronic isofagomine (2) made strong electrostatic interactions with two catalytic glutamates of GUSs, resulting in the most potent inhibition (Ki ≥ 11 nM). C6-propyl analogue of 2 (6) displayed 700-fold selectivity for opportunistic bacterial GUSs (Ki = 74 nM for E. coli GUS and 51.8 μM for RgGUS). In comparison with 2, there was 200-fold enhancement in the selectivity, which was attributed to differential interactions between the propyl group and loop 5 residues of the GUSs. The results provide useful insights to develop potent and selective inhibitors for undesired GUSs.