If you end up digging Foucault's Pendulum, check out The Name of the Rose by Eco. Note that Eco's books are not breezy reading. The dude is full of ideas and an eloquent writer, but he deals with pretty heady material. The writing is excellent, but be prepared to be reading some paragraphs a few times before you grok them.
The Name of the Rose is set in a Christian monastery in the 1300s, so it's not exactly gnostic or anything, but the setting presents an opportunity for Eco to explore many esoteric ideas that are kinda tangential to the thing you are sort of looking for.
It would also be on my short list for best postwar novel of the 20th century.