Mass is commonly regarded as an intrinsic property of matter, but modern physics reveals particle masses to have complex origins, such as the Higgs mechanism in high-energy physics. In crystal lattices such as graphene, relativistic Dirac particles can exist as low-energy quasiparticles with masses imparted by lattice symmetry-breaking perturbations. These mass-generating mechanisms all assume Hermiticity, or the conservation of energy in detail. Using a photonic synthetic lattice, we show experimentally that Dirac masses can be generated via non-Hermitian perturbations based on optical gain and loss. We then explore how the space-time engineering of the gain/loss-induced Dirac mass affects the quasiparticles. As we show, the quasiparticles undergo Klein tunnelling at spatial boundaries, but a local breaking of a non-Hermitian symmetry can produce a novel flux nonconservation effect at the domain walls. At a temporal boundary that abruptly flips the sign of the Dirac mass, we observe a variant of the time reflection phenomenon: in the nonrelativistic limit, the Dirac quasiparticle reverses its velocity, while in the relativistic limit the original velocity is retained.