The bacteria that cause gingivitis are in fact contagious, and can be passed on in the saliva through, for example, kissing or sharing utensils. Does that mean you’ll get gingivitis if your partner has it, though? Not necessarily!
The bacteria that cause gingivitis are actually present in many healthy mouths, too. They’re usually kept in check by the immune system and the good bacteria that also live in the mouth, as well as daily brushing and flossing habits.
However, if something disturbs this balanced system – poor oral hygiene, an impaired immune system, smoking, etc – the bacteria can thrive, and you may develop gingivitis.
So while you should make the effort to avoid transmission – e.g. not sharing drinking glasses or toothbrushes – your best form of protection is to always maintain excellent oral hygiene, diet and lifestyle habits.