Powering issues with mega

Use a 12V supply with a current rating that will handle the stepper and DC motor. Use a buck converter (12V to 5V) and connect the 5V output to the Mega 5V pin.

Make sure that the 12V supply is capable of enough current for the stepper coil current plus the DC motor stall current plus some overhead (1.5 times, minimum).