The English is correct: "to the Gospel of John" is a use of the dative possessive - it is a relatively formal form of grammar.
"...the first sentence to the gospel of John ..." can be understood as "... the first sentence that attaches/belongs to the gospel of John
"The entrance to the castle is guarded." = "The entrance of the castle is guarded." = "The castle's entrance is guarded."
"Have you got the box to this toy?" = "Have you got the box of/for this toy.
"The secret to the trick is to deceive your audience." = "The secret of the trick..."