Nick D’Agosto and Andrew Santino will join Greta Gerwig in CBS’ comedy pilot “How I Met Your Dad.”

The actors, who are best known for their work on “Masters of Sex” and “Mixology,” respectively, will round out the “How I Met Your Mother” spinoff’s primary cast, which also includes Drew Tarver and Krysta Rodriguez.

The show tells a “HIMYM”-esque story from a female point of view (Gerwig’s character of Sally). D’Agosto will play Frank, Juliet’s (Rodriguez) coworker who falls for Sally, while Santino will take the role of Danny, an uptight lawyer and Sally’s older brother.

Santino is a guest star; his casting is in second position to his ABC sitcom “Mixology.” D’Agosto will continue as a regular on Showtime’s “Masters of Sex.”

The pilot, from 20th Century Fox TV, was written by Emily Spivey and “HIMYM” co-creators Carter Bays and Craig Thomas. Fellow exec producer Pam Fryman will direct.

Although the show is set in New York, the pilot will film in Los Angeles and move to NYC if it goes to series.