The actor plays a womaniser who embarks on a career as a pharmaceutical representative in the film, based on the book Hard Sell: The Evolution of a Viagra Salesman, by Jamie Reidy.
Gyllenhaal read up on the little blue pill to acquaint himself with the drug, and then tested his memory by trying to impress doctors.
He tells Britain's Total Film magazine, "Viagra has a huge booklet on what it is, the side effects and all the chemical components. I would memorise these things. And we would improv them and then I would sell to the doctors when I had learnt from them."
But the cheeky star refuses to confess whether he's tried Viagra, joking, "There are some things I have to keep for myself!"