Gotta have protein to build if you’re weight training. Fasting while training will just make you extra skinny. Just do light exercise, walking, stretching while fasting, load up when working out heavily. Fasting will slow your gains, but you’ll probably feel better for it. I’ve done this myself.
Long term fasting just doesn’t work with building muscles. The fundamental process ot build muscles is to break them down then bring them back up with adequate protein which is impossible when long term fasting.
A happy median would be to do intermittent fasting or maybe alternate day fasting but make sure to get sufficient protein when you do eat.
If you’re set on the 5 day fast try scheduling your workouts around it and only doing half of what you’re supposed to.
I do ADF and lift, I’ve organized it so I eat on my lifting days but I also keep my workouts short 30-45 min which isn’t ideal but you’re not gonna miss that if you’re consistent with lifting. If anything it’s a deload week