In the first season episode "Dead Man Talking," McGee's interest in writing first comes up when he's on stakeout with Tony DiNozzo (Michael Weatherly). Surprised that McGee has never seen Airwolf, Tony asks what he does on weekends. "Well, I write," McGee says. "Yeah, try to write. Mysteries." When DiNozzo laughs, McGee seems embarrassed, but his coworker says they're bonding, and asks where he gets his ideas from. When McGee says, "Cases. Like this one," Tony asks if that's plagiarism.
McGee's clandestine pastime comes up again in the fourth season episode "Twisted Sister," when Tony and Ziva (Cote de Pablo) meet his sister Sarah (Troian Bellisario) and she calls them by their fictionalized names, not knowing that McGee's books are meant to be a secret. They go out and pick up a copy of his novel, Deep Six: The Continuing Adventures of L.J. Tibbs, which he's written under the pseudonym Tom E. Gemcity, and read aloud to him the way they're described in the story. The tale focuses on Sarah's seeming involvement in a murder.
It's about 10 episodes later, in "Cover Story," that the novels become the major plot point of an episode.