We present an analytic computation of the gluon-initiated contribution to diphoton plus jet production at hadron colliders up to two loops in QCD. We reconstruct the analytic form of the finite remainders from numerical evaluations over finite fields including all colour contributions. Compact expressions are found using the pentagon function basis. We provide a fast and stable implementation for the colour- and helicity-summed interference between the one-loop and two-loop finite remainders in C++ as part of the NJet library.