Given a Lie groupoid G over a manifold M, we show that multiplicative 2-forms on G relatively closed with respect to a closed 3-form phi on M correspond to maps from the Lie algebroid of G into T* M satisfying an algebraic condition and a differential condition with respect to the phi-twisted Courant bracket. This correspondence describes, as a special case, the global objects associated to phi-twisted Dirac structures. As applications, we relate our results to equivariant cohomology and foliation theory, and we give a new description of quasi-Hamiltonian spaces and group-valued momentum maps.