I was playing my Pokemon diamond on my R4 (and it was Japanese). Then I went to the place where you can battle in double battles and I sent out a Pokemon and a Hoothoot I beat a few of my opponents Pokemon and my Hoothoot leveled up. Then my Hoothoot got defeated. After I won the battle my Hoothoot evolved!
So in short: Is it possible to evolve when your Pokemon is fainted?
It depends on the Pokemon. According to Bulbapedia:
However, it can still evolve after battle if the required criteria were met (unless the player blacks out, if the Pokémon evolves by leveling up, or is Galarian Farfetch'd)...
Yes. As long as the pokemon meets all its prerequisites for evolving, it will evolve, regardless of status or if it is currently fainted.