"If I Only Had a Heart", a tune that Doctor Ira Graves used to whistle, is a song from the 1939 movie adaptation of the book, sung by a mechanical man. Graves also compared Data's desire to become more Human to the mechnical man's quest of being Human. (TNG: "The Schizoid Man")
When Doctor Beverly Crusher was caught in a shrinking warp bubble and began to realize how easy it would be to leave the bubble, she said "Click my heels together three times and I'm back in Kansas?", referencing a phrase from The Wizard of Oz, spoken by the main character, Dorothy. (TNG: "Remember Me")
The Clown quoted The Wizard of Oz from Harry Kim's memory, stating "There is no place like home" and mocked the Ensign because he was restrained and thus not able to "click his heels together three times". (VOY: "The Thaw")
Background information Edit
Jean-Luc Picard's line to Lily Sloane in Star Trek: First Contact about not being in Montana any more is an obvious reference to a line in the 1939 MGM-produced movie version of The Wizard of Oz about not being in Kansas anymore.
The Wizard of Oz is one of the few real-life movies referenced in Star Trek not produced by Paramount Pictures.