The singer-songwriter Sufjan Stevens thought he disliked ballet until the New York City Ballet dancer Justin Peck asked him for permission to choreograph a piece to his electronic song cycle, “Enjoy Your Rabbit.” The ballet, “Year of the Rabbit,” was a raging success in 2012, and Mr. Stevens — famous for his folk-inspired melodies, haunting narratives and eccentric large-scale projects — became a convert.

Now Mr. Stevens, 38, has composed an original score for a new work by Mr. Peck, who at 26 is widely viewed as one of ballet’s most promising choreographic talents. The piece, “Everywhere We Go,” will have its premiere on May 8 at City Ballet’s spring gala. After a recent rehearsal in which Mr. Peck was still teasing out the details, the two artists talked to Roslyn Sulcas. Mr. Stevens is impulsive and humorous, Mr. Peck reflective and contained. Here are excerpts from the conversation:

Q. How did the idea of using Sufjan’s music for “Year of the Rabbit” come about?

JUSTIN PECK I first heard “Rabbit” on WNYC, in a profile of a string quartet who had done these arrangements of his “Enjoy Your Rabbit” album. I was really taken with the music, found it really innovative and danceable, and I kind of kept it on my radar. I started experimenting with it during a few sessions at the New York Choreographic Institute, and Peter Martins [City Ballet’s ballet master in chief] was encouraging. When he asked me to do a piece for the company, I invited Sufjan to the ballet and told him what I wanted to do.

SUFJAN STEVENS You know, actually, when you first approached me I was rolling my eyes, because I was so flabbergasted that you wanted to use this music that most of my fans disliked and that was an anomaly for me. I’m known for folk songs. This was sort of a hobby, goofing around with electronics, I wasn’t even a full-time musician then. It has beats and sound effects — a lot of it is really aggressive. There is a real discrepancy between this album and my songwriting, but it was transcribed for string quartets and then for Justin’s ballet. It’s this funny little project that won’t die.

Were you surprised to be approached by a choreographer?

STEVENS Not really. I’d had requests before from choreographers, mainly college students doing liturgical modern dance. But I didn’t know anything about ballet. When I moved to New York, I had a ballet friend who dragged me to “Apollo,” and I hated it. Ballet seemed so anachronistic, so formal and classical and archaic and irrelevant to pop culture, the world of YouTube and reality television. I didn’t understand it.