After earning a BS in education he moved to New York City to pursue a career as a comedian. There he discovered that his physician, Jack Weinstock, had a skill for writing, and soon the two were contributing sketch comedy to night-club performers including Kaye Ballard and Eileen Barton, and then to the Broadway review Tickets Please. They worked extensively in early television, particularly the children's programs Howdy Doody and Tom Corbett, Space Cadet, although they also sold material to such mainstream performers as Jackie Gleason. They achieved their first Broadway success as co-authors of the book for How to Succeed in Business Without Really Trying in 1962, for which they shared in two Tony Awards.
Later, Gilbert and Weinstock wrote the books for Hot Spot, which starred Judy Holliday, and Catch Me If You Can, a murder mystery based on a French play by Robert Thomas. Weinstock died in 1969, as the team was writing another Broadway musical, The Candy Store.