Qubits are physical, a quantum gate thus not only acts on the information carried by the qubit but also on its energy. What is then the corresponding flow of energy between the qubit and the controller that implements the gate? Here we exploit a superconducting platform to answer this question in the case of a quantum gate realized by a resonant drive field. During the gate, the superconducting qubit becomes entangled with the microwave drive pulse so that there is a quantum superposition between energy flows. We measure the energy change in the drive field conditioned on the outcome of a projective qubit measurement. We demonstrate that the drive's energy change associated with the measurement backaction can exceed by far the energy that can be extracted by the qubit. This can be understood by considering the qubit as a weak measurement apparatus of the driving field.