During the Cannes press conference for This Must Be The Place, a journalist suggested that sex can improve creativity.
She then noted that, along with Terrence Malick's Tree of Life, Penn had two films in this year's official selection.
The actor was asked if Johansson had inspired him, prompting him to laugh and make a reference to the actress's final scene in Sofia Coppola's Lost In Translation.
"I don't know if you saw that movie she made with Bill Murray but the secret whispered in the ear remains a secret," Penn said.
Johansson's representative issued a statement last month insisting that the star is not pregnant.
> Our complete Cannes Film Festival coverage