The first measurement of the cross section ratio $\sigma_\mathrm{ t \bar{t} b \bar{b}} / \sigma_\mathrm{ t \bar{t} jj }$ is presented using a data sample corresponding to an integrated luminosity of 19.6 fb$^{-1}$ collected in pp collisions at $\sqrt{s}$ = 8 TeV with the CMS detector at the LHC. Events with two leptons ($\mathrm{e}$ or $\mu$) and four reconstructed jets, including two identified as b quark jets, in the final state are selected. The ratio is determined for a minimum jet transverse momentum $p_\mathrm{T}$ of both 20 and 40 GeV/$c$. The measured ratio is 0.022 $\pm$ 0.003 (stat) $\pm$ 0.005 (syst) for $p_\mathrm{T}$ greater than 20 GeV/$c$. The absolute cross sections $\sigma_\mathrm{ t \bar{t} b \bar{b}}$ and $\sigma_\mathrm{ t \bar{t} jj }$ are also measured. The measured ratio for $p_\mathrm{T}$ greater than 40 GeV/$c$ is compatible with a theoretical quantum chromodynamics calculation at next-to-leading order.