NEMA23 with no wiring harnes

Hello All,
I need some help please. My x carve was shipped with the NEMA 23 w/wire harness. I purchased a backup motor in case I lost a motor (well I am rapidly loosing steps in my z-axis) I think I am at the lost motor stage. It is causing me huge engraving issues. The replacement motor has 4 wires hanging out of the back.

Would someone please recommend how you would connect the wires please? if I have to buy a new z-axis wire then so be it (I have emailed Inventables), but I have to get this machine back running to normal.

I have read and tried every post to resolve this issue. I have even reduced my plunge rate to 7 in/min and I have yet to achieve 2 engraved letters that are a like. I have resent the configs of the machine as I thought the safety height change threw me off based on another post/thread.

Thank you in advance