I mean, Peter was pretty dumb by taking off his mask just because he was supposed to be among allies. However, Mysterio already knew he was Peter Parker, as he was spying on him in Venice. How did he know?
Yes, he was.
@Optimusprimebumblebee "Neo Astral-X" 123 Mysterio was already spying on Peter before the confrontation with the water Elemental. He had no reason to spy on him if he didn't know his identity.
I mean, Peter was pretty dumb by taking off his mask just because he was supposed to be among allies. However, Mysterio already knew he was Peter Parker, as he was spying on him in Venice. How did he know?