5 is possible with the RAMPS 1.4 board.
Software for 4 won’t be cheap, unless fusion 360 does it. CAM software is outrageously expensive. We got lucky with estlcam and fusion 360.
You are on your own with the extra axis though, that is a big undertaking.