We compute the master integrals required for the calculation of the double-realemission contributions to the matching coefficients of 0-jettiness beam functions at next-to-next-to-next-to-leading order in perturbative QCD. As an application, we combine theseintegrals and derive the double-real gluon emission contribution to the matching coefficient Iqq(t;z) of the quark beam function