Just tested this on Pokemon Black. Outlined in case it was not clear to some people:
1) Pokemon must evolve by level up. Obviously. 2) Opponent trainer must have more than one pokemon. 3) Pokemon must gain enough exp to reach the level it requires for evolution and it must do this BEFORE the opponents last pokemon. 4) Pokemon faints before the battle is over. Battle is still WON, mind you. 5) Evolution scene.
However... my evolved pokemon still had 0 HP. Now, I'm not calling TC a liar though, rather, I have a theory. It should be known that if you use a rare candy on a fainted pokemon, they will still gain a level, but they will also be brought back to life. This isn't because the rare candy itself is reviving the pokemon, but because the pokemon gained HP through levelling up. I'm not sure if there is a certain amount of HP one must gain through this to be left alive or not. For what its worth, I tested a Sewaddle into Swadloon.
I'll try to test something higher level/larger increase in base HP to see if I get a different result.
Edit: Did Tynamo (Base 35 HP) into Eelektrik (Base 65 HP). Tynamo was level 39 with 78 max hp, fainted before battle ended, then evolved into Eelektrik and had 108 max hp. Still fainted.