Mahin was the son of a successful advertising executive, also named John Lee Mahin. The younger Mahin attended Harvard University for a couple of years; he then left for a newspaper job, and became a protege of Ben Hecht. He also acted for a time, including an appearance in a play by Eugene O'Neill. His screenwriting career began in the early 1930s; he penned scripts for Treasure Island (1934) and Captains Courageous (1937) among other films. He also made uncredited contributions to a number of significant pictures, including Scarface (1932), A Star is Born (1937), and The Yearling (1946), among others.
Mahin had a close professional relationship with director Victor Fleming; he worked with Fleming on the set during shooting, performing final rewrites of screenplays as they were being filmed. Once Fleming became the director of The Wizard of Oz in November 1938, he brought Mahin onto the project to fulfill this same function.
"At Fleming's request, Mahin continued to work on the script throughout the shooting, often providing what he referred to as 'little tag lines' to put a laugh at the end of a sequence." The actors soon learned that they might have new script pages to learn at the start of each day's shooting, instead of the pages they had learned the previous evening.
Mahin's career continued productively long past 1939. He wrote scripts for Tortilla Flat (1942), Quo Vadis (1951), Elephant Walk (1954), Heaven Knows, Mr. Allison (1957), and North to Alaska (1960), among many other projects.