network desing - 2 gateways

Hi have a network 192.168.1.0/24 with DHCP 192.168.1.50-192.168.1.150 and gateway 192.168.1.151/24 (the DHCP server is in 192.168.1.151).
Now some DHCP users need to out with gateway 192.168.3.1/24 being able to access 192.168.1.0/24.
Sometimes the gateway 192.168.3.1 is out and need to redirect to 192.168.1.151.
Any idea how I should do it?

Thanks

\m/(><)\m/

Your explanation makes no sense.
However it seems your saying that sometimes your networks go down?
Well maybe you should consider a different router that is more stable?

Not sure I understand OP explanation, but this might guide you in the right way

https://wiki.mikrotik.com/wiki/Advanced_Routing_Failover_without_Scripting