I2C bus isolation for dummies
I am not too convinced that using an external relay is a good solution, but to answer your question, the terms to look up are "low voltage signal relay"

Mouser has a few:
https://no.mouser.com/Electromechanical/Relays/Low-Signal-Relays-PCB/_/N-5g38/

You have not specified a part number for the two masters, but I presume that they are a microcontroller of some kind. Most of these devices, usually allow to turn off the pullups, which means that all that you need to do is to have them externally.

Alternatvely, maybe something like a dual I2C bus buffer could help, or a level translator which can be enabled/disabled at will, might even work better.