It would hinge on the wizard being surprised
The idea of the wizard being taken aback by an action and not having a chance to react has a mechanical representation in the rules, it's called the surprised state and is part of the initiative rules, but let's cover a few things first.
Firstly, while not explicitly covered either way in the rules, you can take actions (and bonus actions and reactions) out of combat. See What actions/bonus actions/reactions can a character perform out of combat? and Can a Bonus Action be used outside of a combat encounter? for more on the topic. The combat rules, or initiative specifically, are a tool the DM can use when many things start happening all at once (eg. combat).
So, without rolling initiative, all the wizard's conditions for casting counterspell should be met (a creature they can see can be seen casting a spell). If you do roll initiative though, the wizard would still be able to use its reaction unless it was surprised and its turn is after the PC's. Whether it is surprised is wholly up to the DM, but personally I would land on them seeing the PC do this making them not surprised. If they are surprised they would be able to take the reaction to cast counterspell once they'd had their turn (they wouldn't have been able to do anything on that turn).
However, having everyone roll initiative shouldn't be necessary unless the wizard (or any other PCs or NPCs) would follow up on the spell casting (retributive fireball?). Instead, if you're just rolling initiate for one interaction for two participants, do what I do and simplify it to a Dexterity ability check contest. This might be a good tool also for cases like this where the later outcome is heavily depended on the first action. (There would presumably not be any combat if the wizard becomes charmed and I find some players rather jump to conclusions, and swordpoints, once you tell them to roll initiate and that stings for the player who were trying to charm).