Yes it would be illegal as you must always have your brake lights showing to following traffic.

Is your gearbox stuck in reverse?