You raised an excellent point, which is not as simple a UV-Vis spectrophotometry because most molecules do no fluoresce or emit light, whereas atoms do. This issue makes an atomic absorption experiment slightly more challenging (at least in principle). The critical question is "what" signal reaches the detector. How does one distinguish the contribution of flame emission from the hollow cathode lamp (HCL) beam? Last but not least, is there is a way to distinguish atomic emission due to HCL?
Have a look at a typical AAS instrument. The critical component is the chopper, which is nothing but a rotating mirror with holes. It merely blocks the light from reaching the flame while rotating at an exact frequency.

You can see only two signals are needed in an atomic absorption spectrophotometry experiment: a) Light beam intensity when there are no atoms in the flame and b) light beam intensity when analyte atoms are present in the flame.
You aspirate a blank (no analyte solution) into the flame- this sets the 100% transmission or absorbance = 0 at the chosen wavelength. Ignore the reference beam; it is for ensuring that the lamp is stable. We are only interested in the beam passing through the flame.
Next, you would aspirate your analyte solution into the flame. Let us take Na as the most straightforward example. There is light absorption by Na atoms in the flame, leading to a reduction in the HCL beam's light intensity after passing through the flame. The ratio of light intensity in steps 2 and 1 gives the transmittance, which is easily converted into absorbance.
However, there is an almost continuous emission spectrum from the flame too.
Here is the smart idea. I do not know who came up with it. The detector continuously sees the background emission from the flame. However, the light beam from the hollow cathode lamp reaches the detector alternately at a particular frequency due to the rotating chopper. The electronics are tuned to register only the light, which is oscillating due to the chopper
- The critical but no so critical problem: When atoms absorb a specific wavelength, they emit precisely the same wavelength as you noticed in your post in the flame (called atomic fluorescence). the chopper cannot stop that light. Hence it is part of the transmitted light beam.
The good news is that atomic fluorescence is not directional, unlike the light beam from the HCL. Secondly, the intensity of atomic fluorescence light is so small compared to the HCL beam intensity that it is practically negligible. There is no way to prevent atomic fluorescence from reaching the detector in an atomic absorption experiment, to the best of my knowledge.
Can we see stars during daylight? Stars are always there and "part" of the sunlight. However, stars contribute very little to the daylight. In the same way, atomic fluorescence contribution in an atomic absorption experiment is almost null because the hollow cathode lamp beam is quite strong as compared to the atomic fluorescence in random directions.