We soon realize, in this riveting Long Wharf production, that the simple search is more than it first appears, as it reveals a cosmic puzzle that makes “The Da Vinci Code” seem like a game of hide-and-seek.

On this rainy night, the Librarian has rented a dilapidated, leaking lecture hall (rendered with authentic dismalness by Craig Siebels and lit by Paul Whitaker). In this setting, with slides, audiotapes, a chalkboard and an increasingly feverish narrative, he presents his evidence of “significant scraps … to prove a life … and justify another.”

With an insider’s knowledge of how to maneuver through the world of dusty files and stacks — sort of a “CSI” expert for bureaucracies — the clerk’s clever detective work broadens as we, too, get swept up in his astonishing discoveries. His curiosity turns into an obsession, his research into an odyssey, as he travels the globe following what appears to be a time- as well as land-traveling subject.

The mystery man, the unnamed Librarian eventually suspects, is the mythical Wandering Jew. That’s the cobbler who, legend has it, spurned Jesus from his door on the way to the crucifixion and, in so doing, was condemned to wander the world through time until the Second Coming.

As the clues turn to the fantastical and the evening becomes surreal, the Librarian challenges the aud to take his findings on faith: “Would you recognize a miracle if you saw one?”

But what makes Berger’s play a theatrical miracle of its own is its reach: This is not just a who-did-it mystery but a larger examination of existence, mortality and the indomitable spirit of even the most incidental of men living on the margins of their times.

In this stellar production, skillfully helmed by Eric Ting, Mark Nelson plays the Librarian with a comic, manic intensity that’s both beguiling and anxiety-producing at the same time. Nelson fills his philosophical everyman with passion, regret, resilience, defiance and, finally, a transcendent joy. But he just as cannily reveals the character of the man being pursued, finding an emotional bond between the two.

However, Ting’s thematic touch of having the leaking roof increasingly fill the stage with water — taking the play into an area that evokes Beckett as well as the Bible — dampens the final triumphant moments.

Still, the perf and the play are powerfully human and ultimately sublime.

Set, Craig Siebels; costumes, Jessica Wegener; lighting, Paul Whitaker; sound, Corrine K. Livingston; original music, William H. Ruth; production stage manager, Charles M. Turner III. Opened May 17, 2006. Reviewed May 18. Runs through June 11. Running time: 1 HOUR, 30 MIN.