It’s become standard practice for TV shows to use edgy, contemporary songs at key plot points, whether it’s an OMG moment on Gossip Girl or the latest Izzie drama on Grey’s Anatomy.

Typically, those songs are selected after the plots are written. But this season, the producers on CBS’ hit show NCIS took the practice to another step, getting exclusive songs by acts ranging from Perry Ferrell to Jakob Dylan as the shows were being crafted, and then taking inspiration from those tunes to help craft the show.

“We did, in my belief, take a new approach on it,” Josh Rexon, the show’s producer, says. “(The goal was) to get a lot of material in, as early as possible . . . and then find some really fun moments to give those to the fans.”

Larry Jenkins produced and compiled the music, which is available as a soundtrack, and features previously released songs by Bob Dylan, John Mellencamp and others. He says the method prevents the songs from becoming “an afterthought.”

“We probably got the producers 50 songs to listen to,” Jenkins says. “They might listen and go . . . , ‘Hey, this Blue October song, this is perfect for this story line. . . . Hey writers, read these lyrics, use this to write your scene.’”

Most shows have music supervisors who scour for tunes to illustrate a scene: A Taylor Swift song from the new album Fearless made its debut on Grey’s Anatomy last fall, while emerging artists get play on shows like Lost and The Hills.