The singer unveiled the song on Radio 1's Breakfast Show, explaining how it was composed with producer Mark Ronson and Tame Impala's Kevin Parker.
"Kevin flew to us from Australia and he came with this idea, that was the beginning of a song called Illusion," she told Nick Grimshaw.
"I work on a typewriter and we would bounce new lyrics back and forth."
She added: "We stripped everything away. Changed the melody, shifted it. I sat at piano, Kevin was on guitar, Mark was on the bass."
Gaga has previously posted several images of her vintage Underwood portable typewriter online, but this is the first time she has confirmed it forms part of her writing process.
She said the lyrics of Perfect Illusion turned into a commentary on social media, and the risks of presenting an idealised version of yourself.
"I believe many of us are wondering why there are so many fake things around us," she said.
"How do we navigate through social media? How do we look through these images that we know are filtered and altered, and decipher what is reality and what is a perfect illusion?
"There are also a lot of things on the internet that are not reality. And I think people are pressured to keep that personal illusion going on in their real lives.
"So this song is about raging against it and letting it go. It's about wanting people to re-establish that human connection."
In keeping with the lyrics, Gaga's vocals are untreated on Perfect Illusion - eschewing autotune in favour of a raw, warts-and-all performance.
Musically, it's a propulsive disco-rock track, built around a perpetually building chord sequence that lends the song a compelling sense of urgency.
The Guardian was less impressed, writing: "The song aspires to the heartbreak and triumph of a classic disco record, but Gaga lacks the grace of a true disco diva."
Perfect Illusion is the first single from Gaga's as-yet-untitled fifth album, her first solo release since 2013's misfiring ArtPop project.
Producer Mark Ronson posted a list of credits for the song on Instagram, revealing that Josh Homme from Queens of the Stone Age played the opening guitar riff.
Earlier this year, Ronson said that Gaga's new album would feature a more "analogue" approach than previous records.
"She's the happiest when she's sitting at a piano, barking orders at a drummer," he said. "That side of her, I don't think a lot of the world has seen."