Yes, it's a real name. But nowadays it's restricted to characters in historical fiction.
Pagan (pronounced "PAY-gan") is a Latin name that derives from Pagani, meaning "country dweller." It is a legitimate given name from the Ancient times. It was used for both boys and girls, although the more feminine Pagana was also an option.
The Ancient Romans and Greeks never referred to themselves as Pagans. A lot of them lived in city states. That didn't come until Christianity spread. I've heard two explinations for this. Either they began to use the word as a euphemism for "bumpkin." They believed that people who still practiced duotheism or polytheism were unenlightened, old-fashioned hicks. Or, the term instantly became derogatory due to their fear of anything having to deal with the wild, which polytheists worshiped. This association wiped out the given name Pagan almost completely from the name landscape.
Pagan is the anti-hero in the young adult series Pagan's Crusade by Catherine Jinks. Pagan is essentially a street urchin when he is picked up by one of the Knights of Templar. He takes Pagan on the Crusades with him. The Knights of Templar is a group that eventually became connected to Witchcraft.
But can Pagan be used as a real name today? Nowadays, Pagan is more often seen as a surname. Although a quick google search shows that it is used as a first name very sparingly.
Ignoring that it could possibly result in a strong negative reaction from ignorant people, it's still not a name I would suggest. What makes you assume that your child will be Pagan? Most Neo-Pagans weren't raised in a Neo-Pagan family. My birth name is Christina. You see how well that worked out. I changed it because the meaning of Christina is no longer true. If the child decides to pick another religious path, the name might feel like a lie rather than a gift.