Horner wrote a magnificent and evocative soundtrack that perfectly captures the atmosphere of the film. While he didn't use any existing classical pieces, his score is heavily inspired by the era's classical music.
You may be thinking of a specific piece, but without more information, it's impossible to know exactly which track you are referring to. If you can describe the scene or the mood of the music, it might be easier to identify it.
If you're interested in exploring the soundtrack, you can find it on streaming services or online music retailers under the title "Master and Commander: The Far Side of the World - Original Motion Picture Soundtrack".