Wiring a compressor to an external building
You can install an isolated neutral buss in the box connect the neutrals to this buss and the grounding conductors to the one that connects to the box case and you will be good to go. Most home stores and electrical supply stores have these isolated busses usually less than 10$ for a small one like you need, make sure if your box has 20 breaker openings to get a buss with close to that many holes, your 240v compressor may not require a neutral and most pumps, or other 240v only devices don't need a neutral.