It's best if you study the materials first, and would be generally expected in contemporary training scenarios, but it's not strictly necessary.
More important is that you be able to spot where students are having trouble with learning the materials, and set them straight.
Just because you know something yourself doesn't mean you can teach it. A lot of expert doctors are not expert teachers; the same is true of expert programmers, mathematicians and other experts.
The skill of a teacher as a teacher is more important than the teacher's skill as a practitioner of the subject taught. The teacher's skill is in identifying the blocks his students encounter in assimilating the subject, and handling them so the student successfully masters the subject.
At the very least you should have some idea of the questions that students are likely to ask and know where they can find the correct answers—even if you don't know all those correct answers at the tip of your tongue.
I teach a class on Git, the popular version control software. Git has options and commands for literally every scenario imaginable, the result of an open-source tool being used by (and improved by!) open source developers for more than a decade. Any given student will never need more than 15% (at most!) of the available options and commands.
When a student asks me a complex and highly specific use case for Git, it is sufficient that I point him in the correct direction: what commands are relevant to his question and what options will help him accomplish his purpose. I don't have to show off my mastery of those advanced options to help him learn them.
Finally, here is a relevant excerpt from one of my favorite Science Fiction novels:
I liked Prof. He would teach anything. Wouldn't matter that he knew nothing about it; if pupil wanted it, he would smile and set a price, locate materials, stay a few lessons ahead. Or barely even if he found it tough—never pretended to know more than he did. Took algebra from him and by time we reached cubics I corrected his probs as often as he did mine—but he charged into each lesson gaily.
I started electronics under him, soon was teaching him. So he stopped charging and we went along together until he dug up an engineer willing to daylight for extra money—whereupon we both paid new teacher and Prof tried to stick with me, thumb-fingered and slow, but happy to be stretching his mind.
—Robert Heinlein, The Moon is a Harsh Mistress
Fake it til you make it
... someone had to say it.