The Harold and Kumar actor will star alongside Chris Smith in the pilot, according to Deadline.
Ex-Men, produced by How I Met Your Mother showrunner Rob Greenberg, focuses on a group of friends living in a short-term rental complex.
Penn will play Gil, a man trying to win back the affections of his wife after he is caught having an affair.
The 35-year-old actor has appeared in episodes of How I Met Your Mother and House.
Penn recently starred in an ABC pilot for the comedy Prairie Dogs.