Switch seperate 12V circuit with Rasp Pi Zero
Traditional doorbells typically work on AC, stepped down from line voltage (120 VAC in the US) to 10-20 VAC. If true in your case, this would explain why an NPN transistor didn't work (only conducts current one way). I like Roger's idea of using a relay as the simplest way that's likely to work. But if you wanted to use a semiconductor, a TRIAC can be made to work. Here's a circuit I found with a quick search on 'low voltage triac' that might serve your purposes.