Holmes was courted by Greg Berlanti, who was a producer on "Dawson's Creek" and is the co-creator and executive producer of ABC's drama about a lawyer (Jonny Lee Miller) who gains prophetic powers.
The idea of bringing Holmes aboard came up in a discussion about how to expand the show's audience in its sophomore year. Berlanti told his fellow producers he was willing to approach Holmes.
"I went and I begged her and she said, `I'd love to,"' Berlanti told a meeting of the Television Critics Association. He called Holmes "an incredible actress and a good friend."
The episode with Holmes, in which she displays her singing and dancing skills, is the season's second and will air Oct. 21. Berlanti declined to detail the story line.
"Eli Stone" has turned musical in the past, with pop star George Michael performing in the series' debut episode. There are plans for Michael to return, possibly on a December episode, Berlanti said.
Holmes, who played Joey Potter on "Dawson's Creek" from 1998 to 2003, has worked in films including "Batman Begins" and "Thank You for Smoking" and is married to Tom Cruise. She's scheduled to make her Broadway debut Sept. 18 in a revival of Arthur Miller's "All My Sons."
Miller can boast a high-profile ex-wife: Angelina Jolie, who gave birth last week to twins with partner Brad Pitt.
When a reporter asked whether Jolie might appear on "Eli Stone" and if Miller would be willing to call her, the actor replied: "You'll have to call her, I'm afraid."