Replacing a membrane switch with a relay for automated testing

I'm looking at your circuit photo. Which transistor is that? Is it E-C-B? Is the transistor's emitter connected? I see the black wire coming over from Ground connected to the row shared with an LED's lead.
You don't really need a transistor, you can run the reed relay from the pin directly, but you still need the diode.