There is a free 3 pin connector on the breakout board near the corner close to the ribbon cables.
If this connection is bridged, I believe (have not tested it) that the drivers will be disabled.
You would need to organize a safety relay driven from the E-Stop signal.
An opto coupler with driven via a 1K2 resistor from the e-stop line with the output to pins 1 and 2 of the 3 pin connector will probably work.
On a 6 pin opto. eg 4n35
Pin 1 opto via 1K2 resistor to E-Stop pin 2.
Pin 5 opto to Enable pin 2.
Pin 2 and 4 opto to pin 1 of enable connector. (0v)
Don't even go near the front panel E-stop wiring as you are ensured of creating smokey havoc.
Attached PDF shows the SX3 BOB circuit.
Problem with above, is that disabling the driver means when E-stop released, steppers will with 50% certainty be one step out, so you need to reference again.
But as you already panicked, you had already lost the plot any way.
Usually, in a timely manner, hitting the space bar on the PC pauses Mach3 and Alt-r will gracefully resume, (but test it first!!)
Some canned cycles like circles and drill cycles resume at next vector, so expect a crash on restart!.
The safest, most reliable way I have found, is to hit single step, and wait for it all to stop nicely. This does not stop the spindle. Hit F5 when movement stops.
I have only used the E-STOP once in 3 years. It is only for emergencies, and I have even seen big machines, that kill the spindle, and keep feeding. Really dumb stuff.