Topological invariants characterizing filled Bloch bands underpin electronic topological insulators and analogous artificial lattices for Bose-Einstein condensates, photonics and acoustic waves. In bosonic systems, there is no Fermi exclusion principle to enforce uniform band filling, which makes measuring their bulk topological invariants challenging. Here we show how to achieve the controllable filling of bosonic bands using leaky photonic lattices. Leaky photonic lattices host transitions between bound and radiative modes at a critical energy, which plays a role analogous to the electronic Fermi level. Tuning this effective Fermi level into a bandgap results in the disorder-robust dynamical quantization of bulk topological invariants such as the Chern number. Our findings establish leaky lattices as a highly flexible platform for exploring topological and non-Hermitian wave physics. Topological materials are characterized by the topological invariants of filled bands, which cannot be used for bosonic systems. Instead, their topological invariants can be found via the transition from bound to leaky modes in photonic lattices.