JENNIFER GARNER has tapped gay pal NEIL PATRICK HARRIS to keep her hunky husband BEN AFFLECK while filming their new movie.

Sources say Jen is petrified hound-dog Ben will succumb to the charms of his gorgeous “Gone Girl” co-star EMILY RATAJKOWSKI.

“Jen has asked Neil to watch Ben like a hawk, especially around Emily,” an insider told The ENQUIRER. “He has a legendary weakness for beautiful women, and Jen’s terrified he won’t be able to resist her.”

The 22-year-old London-born model- turned-actress plays Affleck’s mistress in the thriller. But she’s best known for going topless in Robin Thicke’s “Blurred Lines” music video, which notched a staggering 219 million hits on YouTube.

“It’s obvious Emily has no inhibitions about using her sexuality in her work,” the source said. “And she’ll definitely share some hot scenes with Ben.”

“Gone Girl is based on a best-selling novel about a woman who disappears on her fifth wedding anniversary.

Affleck, 41, plays the missing woman’s husband, while Harris, 40, has the
part of her ex-

The Afflecks and Harris are longtime friends, and Ben recom- mended the “How I Met Your Mother” star for the role, said the source.

“In a way, Jen used the favor bank when she enlisted Neil as an on-set spy,” the source added. “Neil hated getting dragged into their problems, but he reluctantly agreed to tip Jen off to anything suspicious.”

Affleck’s notorious wandering eye was first exposed by The ENQUIRER in 2003 when we revealed that he’d frolicked with a group of Vancouver strippers while engaged to Jennifer Lopez.

J.Lo dumped him, and rumors of marital trouble have reportedly plagued the Afflecks – parents of three young children – almost since they tied the knot in 2005.

“Sometimes Ben’s his own worst enemy,” noted the source. “He’s got gambling issues, a tre- mendous ego and an eye for the ladies. But he really does love Jen and he’s a wonderful father.

“Still, it’s Jen who holds the family together. And right now she’s relying on Neil to keep her husband in line.”