Born in Philadelphia, Pennsylvania, Masteroff graduated from Temple University and served with the United States Air Force during World War II. He studied with the American Theatre Wing from 1949-1951 and began his career as an actor, making his Broadway debut in The Prescott Proposals in 1953.
Following a national tour, Masterhoff's first play, The Warm Peninsula, opened on Broadway in 1959 with Julie Harris, June Havoc, Farley Granger, and Larry Hagman in the lead roles. In 1963 he wrote the book for the Sheldon Harnick-Jerry Bock musical She Loves Me, which garnered him a Tony Award nomination for Best Author of a Musical.
Three years later, when Hal Prince gained control of the rights to John Van Druten's play I Am a Camera and The Berlin Stories by Christopher Isherwood, he discarded the book for a musical adaptation already written by Sandy Wilson and hired Masterhoff to fashion his own. With lyrics and music by Kander and Ebb, Cabaret won the Tony for Best Musical and ran for 1965 performances.
Masteroff's next and final Broadway project, 70, Girls, 70 (1971), was less successful, closing exactly one month after it opened.
Masteroff also has written the libretto for an operatic adaptation of Eugene O'Neill's Desire Under the Elms and the book and lyrics for the musicals Six Wives and Paramour, the latter based on Jean Anouilh's The Waltz of the Toreadors.