We study a generalization of the well-known Dicke model, using two dissimilar atoms in the regime of ultrastrongly-coupled cavity quantum electrodynamics. Our theory uses gauge-invariant master equations, which yields consistent results in either of the standard multipolar and Coulomb gauges, including system-bath interactions for open cavity systems. We first show how a second atom can be treated as a sensor atom to measure the output spectrum from a single atom in the ultrastrong-coupling regime, and compare results with the quantum regression theorem, explaining when they can be different. We then focus on the case where the second atom is also ultrastrongly coupled to the cavity, but with different parameters from those of the first atom, which introduces complex coupling effects and additional resonances and spectral features. In particular, we show multiple resonances in the cavity spectra that are visible off-resonance. We also observe clear anticrossing features, which are particularly pronounced when the second atom is tuned through its resonance.