As Gladys Knight's recording of "Neither One of Us (Wants to Be the First to Say Goodbye)" climbed the charts in 1973, she asked Jim Weatherly, the song's composer, for another love song. He sent along "Midnight Train to Georgia," which Cissy Houston had recorded a year earlier.

Envisioning a seductive, punchy instrumentation behind her, Ms. Knight turned to producer Tony Camillo for an Al Green feel. Within weeks of its release 40 years ago in August, Ms. Knight and the Pips' "Midnight Train to Georgia" reached No.1 on the pop and R&B charts—earning a Grammy in 1974. The song was inducted into the Grammy Hall of Fame in 1999.

Recently, Ms. Knight, 69, Mr. Weatherly, 70, Ms. Houston, 79, and Mr. Camillo, 74, talked about the song's evolution—from a phone call with Farrah Fawcett to Ms. Knight's famed ad-libs. Edited from interviews.

Jim Weatherly: In the late '60s I was living in Los Angeles in a one-bedroom apartment—trying to get recording artists to pay attention to my songs. One evening in 1970, I called Lee Majors, an actor friend who had just started dating model Farrah Fawcett. Lee and I had played college football and we were in a flag-football league together. Farrah answered the phone. She said Lee wasn't home and that she was packing to take a midnight plane to Houston to visit her folks. What a great line for a song, I thought.