Heralded near-deterministic multi-qubit controlled phase gates with integrated error detection have recently been proposed by Borregaard et al. [Phys. Rev. Lett. 114, 110502 (2015)]. This protocol is based on a single four-level atom (a heralding quartit) and N three-level atoms (operational qutrits) coupled to a single-resonator mode acting as a cavity bus. Here we generalize this method for two distant resonators without the cavity bus between the heralding and operational atoms. Specifically, we analyze the two-qubit controlled-Z gate and its multi-qubit-controlled generalization (i.e., a Toffoli-like gate) acting on the two-lowest levels of N qutrits inside one resonator, with their successful actions being heralded by an auxiliary microwave-driven quartit inside the other resonator. Moreover, we propose a circuit-quantum-electrodynamics realization of the protocol with flux and phase qudits in linearly-coupled transmission-line resonators with dissipation. These methods offer a quadratic fidelity improvement compared to cavity-assisted deterministic gates.