“I was writing about a nice house with a pine alley … there was a young man in the house, basically a portrait of who I would be if I grew up in Italy,” the 66-year-old, who grew up in Egypt, tells The Post. “And then there was a young man who comes in the picture … I wasn’t planning on writing that kind of story. It just blossomed out of my own curiosity.”

Written in just three months, “Call Me By Your Name” is a tender coming-of-age tale about Elio, a 17-year-old genius who falls in love with Oliver, a 24-year-old graduate student who’s studying with Elio’s professor father for the summer. When it was published in 2007, critics called it a modern gay classic, albeit one written by a writer who isn’t gay. A film producer bought the rights to the story that same year.

Opening in New York Friday, the film stars Armie Hammer and Timothée Chalamet as the star-crossed lovers. Aciman, who has a brief cameo as Elio’s family’s friend, says he hopes the story’s same-sex romance will resonate with everyone.

‘Everybody assumes that if they suddenly have a stirring for the same sex that it’s only them … that nobody feels this way, but we all do.’

“This is the biggest secret of humanity,” he says. “Everybody assumes that if they suddenly have a stirring for the same sex that it’s only them … that nobody feels this way, but we all do.”

Despite some expressing concern about the seven-year gap between the lovers, Aciman sees nothing wrong with their love.

“[Their relationship] is so consensual, I don’t even give it a second thought,” he says. “There’s clearly abuses out there, horrible abuses, but Elio is the one who asks and Oliver says, ‘We can’t do this. This is wrong.’ We’re not talking about 10-year-olds. [Elio] is almost 18. Would 18 have been a better age? I don’t know.”

Although director Luca Guadagnino made some changes when translating the book to the big screen, Aciman says he’s happy with the final product. “The best scenes in the movie were right out of the book,” he says. “How can I complain?”

He says one of his favorite moments is when Elio’s father (Michael Stuhlbarg) tells his son the importance of being vulnerable in love: “I got a lot of mail from gay men in their 60s who basically said, ‘This book moved me because I only wish my father said that to me.’”

Although the movie ends on the Hanukkah following Elio and Oliver’s summer romance, the book closes 20 years later. Guadagnino’s talked about making a sequel with the same cast, and Aciman says he’s more than happy to collaborate.

“It’s not really a sequel as it’s the rest of the book,” Aciman says. “If Guadagnino does the next movie, he wants to capture the nuances of that love because it’s very absolute. They don’t forget, they cannot put it behind them, they have other lives, but [the love] is there and it’s not going away.”