It works both ways
As a supplemental answer to this and this excellent answer, the reverse process is also possible. Direct bandgap photodoiodes used in photovoltaic mode (it's the photovoltaic effect you are seeing here) they can also luminesce or glow with recombination light when excess e-h pairs are produced.
This can be done with an applied electrical current or even an ion beam, but as explained in the currentexcellent answer to Do III-V based photovoltaics “glow” (photo-luminesce) when illuminated but not loaded? the recombination light can be induced by a photocurrent within the junction, which itself is produced by incident sunlight.