The teaching authority of the Catholic Church does not come from Scripture; Scripture comes from the Catholic Church. The teaching authority of the Catholic Church comes directly from Christ, who gave authority to the Twelve Apostles (including the keys to Peter), who then gave authority to the bishops whom they ordained.
-A8
The four Gospels were written within at most 40 years of Jesus' death and resurrection. Thus, they were available within the lifetime at least of some of the Apostles. The Catholic argument for the teaching authority of the church is indeed derived from Scripture, as opposed to oral tradition, which would support the doctrine of the perpetual virginity of Mary, for example. In the Catholic view, both Scripture and tradition derive from God, even if the instrumentality that has defined what is true Scripture (the Four Gospels vs. the Gospel of Thomas) and what is valid tradition (for instance, the tradition that is the basis for the Chalcedonian definition of the Second Person of the Trinity as opposed to the Gnostic tradition that Christ is pure spirit) is the church.