Drive relay with Npn transistor thanks to RTC and Rpi
Assuming you want to turn the relay on if either an RTC brings an open drain output low or the Raspberry Pi provides a certain logic state, the below circuit would do this: 







simulate this circuit &ndash; Schematic created using CircuitLab

The Rpi GPIO should be brought high to keep the relay in, and it should be push-pull, not open drain. 

The Rpi outputs are not guaranteed 5V tolerant so they cannot be pulled up to 5V reliably. You need a catch diode across the relay, as shown. Further, it is unlikely that either the RTC or the Raspberry Pi will be very happy directly driving a relay- in your circuit about all the relay current goes through the Raspberry Pi or RTC.