You lose Invisibility when you attack or cast a spell.
Case 1. If someone who is Invisible (not Greater Invisibility), but not Hidden (I know they are there) casts a spell, would they lose Invisibility as they are casting, thus allowing me to see them and use my reaction to cast Counterspell?
If yes, then:
Case 2. Same as in Case 1, but the enemy is Hidden from me (they beat my Perception with a Stealth check), and we are in the 5th round of combat (I am not Surprised). Can I still Counterspell?