First: get a party-line agreement. This is a written contract with your neighbor that says, “If the pipe breaks, we split it 50/50 like divorce lawyers.” (Or, if you’re generous, by percentage of toilets used.)
Second: buy insurance. Most standard homeowner’s policies don’t cover shared drain backups unless you add a $20 rider. That’s cheaper than a single plumber bill, which can run $500 to $5,000. And finally: be friends with your neighbor. Not best friends, just “we share a sewage pipe” friends. Bake them a cake. Don’t flush the cake.
Remember, the law on shared drains is really just a glorified handshake through concrete. Treat it with respect, keep the wipes out, and for the love of all that is holy, never flush a sock.