I would define heat as a difference in thermal energy between two separate systems, which can cause a flux. In your case, the difference in thermal energy between the gases and the surroundings.
In the first state, the gases are at a lower temperature (lower thermal energy) than the surroundings, so there will be energy transfer from surroundings to gases, a.k.a. heat flux from surroundings to gases; or better defined: heat flux into the system. (with the system defined as the vessel with the gases)
At the end state, the gases will have a higher temperature than the surroundings due to the reaction energy, thus causing a heat flux from gases to surroundings, or: heat flux out of the system.
IF you assume the system (the gases) to be at constant pressure, then compared to the first state, the system will donate energy to the surroundings, thus making the reaction defined to be exothermic. Usually a better way to determine the endo- or exothermicity of the reaction is to look at the reaction enthalpy. If that is negative, then we call it a exothermic reaction, regardless of the heat flux at that moment.
Maybe someone more specialized in thermodynamics can give a more accurate definition, but I find this workable for me.