In the 1976 classic, “Network,” William Holden’s character questions whether the mentally ill anchorman played by Peter Finch should be put back on camera, worried about exploiting his lack of lucidity for the sake of mere entertainment.

The same concerns could be raised about “The Tonight Show” host Jack Paar repeatedly booking Oscar Levant as a guest knowing he had serious mental health issues. That ethical dilemma is at the heart of “Good Night, Oscar,” a new play by Doug Wright starring Sean Hayes as Levant and Ben Rappaport as Paar.

Levant was a money-in-the-bank guest for Paar. He was quick-witted, self-deprecating, and willing to comment on virtually anything. He also was a brilliant pianist (at one point in the 1940s, the highest-paid concert pianist in the US) and composer (he wrote the music for twenty movies) who also appeared in several movies, including with Gene Kelly in “An American In Paris.”

He was also a world-class neurotic and hypochondriac who abused pills and was committed to psychiatric hospitals several times. In the play, which takes place in 1958, Levant is given a four-hour pass so he can appear with Paar — much to the chagrin of NBC president Bob Sarnoff (Peter Grosz), who worries Levant will say something that would infuriate sponsors and cost the network a lot of money.

Paar convinces Sarnoff he can handle Levant. Then, on the live broadcast, as if to reassure his boss as well as the audience, the host introduces his guest thusly: “Keep this in mind. Appearing here is good for Oscar. He looks forward to it. He enjoys it.” Once Levant is seated, Paar feeds him all sorts of leading questions, each one designed to allow Levant to shine. For example, Paar asks, “What do you do for exercise?” Levant replies, “I stumble and then fall into a coma.”

Wright includes many actual quotes from Levant in “Good Night, Oscar,” which he wrote specifically for Sean Hayes, best known for playing Jack on “Will and Grace.” Hayes is more than up to the challenge, morphing both physically and vocally into Levant in a remarkable performance, for which he was honored with the Tony Award for Best Lead Actor in a Play a few nights ago. Hayes is also a very gifted pianist, showing off his talent towards the end of the show by playing a brilliant rendition of “Rhapsody In Blue” by Levant’s close friend George Gershwin.

Hayes’ performance propels “Good Night, Oscar” beyond its basic backstage-showbiz story. Along with plenty of laughs, the play deftly addresses the exploitation question while introducing modern audiences to the talents of an entertainer who often existed on the edge of sanity.

I give it a 9 out of 10.