The paper is devoted to the study of the initiation and formation of a negative streamer in a sharply inhomogeneous electric field and the generation of runaway electrons (REs) in air and helium at atmospheric pressure and below, as well as in sulfur hexafluoride at low pressure. Nanosecond voltage pulses of negative polarity with an amplitude of 18 kV were applied across a point-to-plane gap 8.5 mm long. The studies were carried out using broadband measuring sensors and equipment with picosecond time resolution, as well as using a four-channel ICCD camera. Using a special method for measuring the dynamic displacement current caused by the redistribution of the electric field during streamer formation, the waveforms of voltage, discharge current, RE current, and dynamic displacement current were synchronized to each other, as well as to ICCD images. Data on the generation of REs with respect to the dynamics of streamer formation were obtained. It was found that REs are generated not only during the breakdown of the gap, but also after that. It has been found that the formation time of explosive emission centers affects the generation of REs after breakdown. Based on the measurement data of the voltage, discharge current, and dynamic displacement current, the electron concentration in the plasma channel after breakdown and the electric field strength near the surface of the grounded electrode were calculated.