I wouldn't assume -DIR or -STEP are connected to ground, the output circuit could be a NPN transistor (open collector). So the safest bet would be to put each (for lack of better description signal) on a separate pole.
Maybe the output circuit of one of the boards can recognize an open circuit, on either the STEP or DIR causing a fault condition.
The user has provided no circuit diagrams so it is really hard to say which way to jump.

It would be the same as asking a programmer to design a routine to process a data packet without actually telling them anything about the format of the data packet.