Low voltage controlled open drain circuit
Either the MOSFET or the BJT will work. 

You might find the transistor (leaded type) easier to work with and it has a bit more margin on the voltage (45V vs. 30V on a 24V circuit). 

Personally I would add a resistor with the MOSFET gate (something like 10K) to make it a little less likely to damage that $500 computer board. It will slightly slow it down (microseconds). It's not necessary for the  MOSFET. It is necessary for the BC547 BJT.