Eric McCormack gets to exhibit his macho side in ‘The Fantasticks.’

The combatant in question is a manly man. He’s wearing high-testosterone black from head to toe and that ultimate flag of machismo -- a full-on beard. His opponent is 20 years younger, but as the two sword fighters thrust and parry, the dark, handsome older man nimbly slices the air -- and his quarry’s equanimity -- into invisible ribbons.

But then, something goes wrong, terribly, terribly wrong.

“I’m sorry,” the macho man says. “It’s my fault.”

Actor Eric McCormack, prepping for his role as the mysterious El Gallo in the romantic musical “The Fantasticks,” has morphed back into the polite, self-effacing guy people expect. And when his fencing style tips “High School Musical’s” Lucas Grabeel off his mark during a recent rehearsal, the former “Will & Grace” star is quick to take the rap.

Eric McCormack: An article in Monday’s Calendar about actor Eric McCormack misspelled the last name of his costar in the TNT series “Trust Me,” Tom Cavanagh, as Kavanaugh. —

The setting is Screenland Studios in North Hollywood, where the world’s longest-running off- and off-off-Broadway musical, which ran for 42 years in New York, is shaping up for its zillionth production: Reprise Theatre Company’s spin on the 1960 classic by Harvey Schmidt and Tom Jones, which opens Wednesday at UCLA’s Freud Playhouse. The cast is rehearsing “The Abduction Ballet,” in which El Gallo and two actors playing actors faux-kidnap a young woman to help her rediscover her passion for her estranged true love. (The scene, originally called “The Rape Ballet,” was rewritten and toned down by its original creators 15 years ago.)

“The Fantasticks,” a charming musical fable with a memorable score, tells the story of two neighbors who entice their children into falling in love by pretending to be enemies and giving them reason to rebel. Reality intrudes in the second act and the young couple breaks up, only to be buffeted by a cruel world and eventually reunited, older but wiser. Another revival is currently running off-Broadway, and Reprise’s artistic director Jason Alexander promises to put his stamp on the L.A. production in part by ramping up the dreamy first act with Cirque du Soleil-inspired ambience.

As for McCormack, after eight years playing gay lawyer Will Truman on TV’s “Will & Grace,” perhaps it isn’t surprising that his brush with action/adventure should be as a member of “the Fred Astaire cavalry,” as choreographer Lee Martino dubs El Gallo and friends. But while the swords are made of tin, the struggle is real for McCormack. In an increasingly open culture, where a performer’s sexual identity is yet another variable vulnerable to typecasting, the married father of a 6-year-old son is in an ironic pickle: He’s trying to get audiences to accept him as the straight guy he really is.

He thought he’d found the perfect vehicle in TNT’s dramedy “Trust Me,” in which he costarred with Tom Kavanaugh as a married ad man in Chicago. But the show never picked up steam and was canceled in March after one season.

“I don’t think America got to know who I was by watching me play gay for eight years,” says McCormack, 46. He’s quick to add, “I never want to talk about [“Will & Grace”] like it’s a burden, because it’s not. It was a show I’m very proud of.”

Later, Reprise’s Alexander, who played George Costanza on “Seinfeld,” observes that McCormack is in a particularly sensitive position as he builds his life after Will. The two men have a lot in common: They played iconic roles in long-running hit sitcoms that are etched into people’s memories, and they’re the kind of straight guys who’d rather sing in musicals than watch football.

But, notes Alexander, who won a Tony Award for his starring role in “Jerome Robbins’ Broadway”: “He has a different challenge than most of us. Whether it’s me as George or Carroll O’Connor as Archie Bunker, we can say, ‘Hey, I’m not a neurotic,’ and Carroll O’Connor can say, ‘Hey, I’m not a bigot. I played one.’ It’s a little harder for Eric to go, ‘Hey, I’m straight. Don’t hang me up with the gay thing.’ He’s got a little more political pressure on him.”

By the same token, the chance to defy audience expectations by casting McCormack in the dual role as the uber-masculine El Gallo and the omniscient narrator appealed to Alexander, whose children attend the same school as McCormack’s son, Finnegan. “El Gallo is very flamboyant and sexy and funny, and immediately I went, ‘Eric’s got that,’ ” Alexander says. “The challenge for Eric in this show is this kind of very centered, warm, quiet, sensitive narrator. That is a muscle he hasn’t often been called on to use.”

The classically trained, Toronto-born actor began his career in theater, with five seasons at Canada’s prestigious Stratford Shakespeare Festival. (More recently, he starred in “The Music Man” on Broadway in 2001 and as an emotional villain in Neil LaBute’s “Some Girl(s)” off-Broadway two years ago.)

McCormack’s Stratford stint ended in 1989, when the legendary English director and actor John Neville informed McCormack that he wasn’t invited to return. “He said, ‘I didn’t really like what you did in “A Midsummer Night’s Dream,” ’ " McCormack says in Neville’s aristocratic accent. “ ‘I find it very modern. Have you ever thought of doing situation comedy?’

“He said it in a way, like it was demeaning. He was saying, ‘Perhaps you should go into that horrible American television.’ And I thought, ‘He’s right.’ I realized that slowly but surely, the other side of me was emerging, the funny side, the modern side that loves Woody Allen and Albert Brooks, the funny Jewish guy. I always say, ‘I’m not a Jew, but I’m Jewish.’ ”

McCormack’s flair for comedy is well known, but he actually went on to an eclectic career in television and film, playing the ruthless power broker Col. Francis Clay Mosby in “Lonesome Dove: The Series” and “The Outlaw Years” during the mid-'90s, an adventurous reporter in the “Lost World” films and supernatural beings and scientists in various sci-fi projects, including “The Outer Limits” and the A&E miniseries “The Andromeda Strain” as well as the recent movie spoof “Alien Trespass,” in which he doubled as a scientist and an alien named Urp. He recently shot a half-hour comedy pilot for ABC and “Scrubs” executive producer Tad Quill. It’s a buddy show, with McCormack playing a heart surgeon and new dad opposite Reno Wilson as a contractor and empty nester.

“The basic truth about my post-Will plan is that there isn’t one,” McCormack says. “I’m kind of all over the map. I like to think of myself as versatile. I certainly need to push myself to stay interested.”

During his Emmy- and Screen Actors Guild award-winning run as Will from 1998 to 2006, McCormack wasn’t sure he’d get the chance to stretch. He would fret about typecasting and F. Scott Fitzgerald’s famous remark that there were no second acts in American life. “That used to haunt me throughout ‘Will & Grace.’ I thought, is that true? What if I don’t get a second act?”

These days, second acts in life and onstage are what interest him. “I don’t need to see another production of ‘Romeo and Juliet’ in any form,” he says. “I don’t really care about 14-year-olds in love. I’m more interested in watching how people survive marriage, how they survive middle age, how they survive the disappointments and the choices that have led them to where they are. ‘The Fantasticks’ has that too, the idea in the opening song [“Try to Remember”] that in September you’ll learn that without going through some pain, there’s no gain.”

For McCormack, that journey has involved growing into the role of the hero, a part he had always avoided.

“I needed to have my experience as Will to come out the other side so I could say, ‘OK, I’m getting more comfortable in that role,’ ” he says. “Maybe it’s my age, being a father. Whatever it is, I do feel that I could be a protector now. I could be a fighter. El Gallo has a certain machismo that I was uncomfortable with before, but I’m becoming more comfortable with myself as a grown-up.”