We investigate how photo-induced topological phase transitions and the magnetic-field-induced quantum Hall effect simultaneously influence the Casimir force between two parallel sheets of staggered two-dimensional (2D) materials of the graphene family. We show that the interplay between these two effects enables on-demand switching of the force between attractive and repulsive regimes while keeping its quantized characteristics. We also show that doping these 2D materials below their first Landau level allows one to probe the photoinduced topology in the Casimir force without the difficulties imposed by a circularly polarized laser. We demonstrate that the magnetic field has a huge impact on the thermal Casimir effect for dissipationless materials, where the quantized aspect of the energy levels leads to a strong repulsion that could be measured even at room temperature.