In this paper, we study a classification of boundary conditions with symmetries for a five-dimensional Dirac fermion on a quantum graph. We find that there is a nontrivial correspondence between the classification of boundary conditions at the vertex on the quantum graph and that of the symmetry-protected topological phases of gapped free-fermion systems, which are classified into ten symmetry classes by the time-reversal symmetry, particle-hole symmetry and chiral symmetry. A Hermitian matrix which specifies the boundary conditions in our model corresponds to a zero-dimensional Hamiltonian in the gapped free-fermion systems. Furthermore, symmetries in our model give the condition that restricts the parameter space of the boundary conditions. These conditions are identical to the ones in the gapped free-fermion systems that the Hamiltonian with the symmetries should satisfy. We also show that the topological number for each symmetry class in our model implies the presence of 4d massless fields localized at the vertex of the quantum graph, like gapless boundary states for the free-fermion systems from the bulk-boundary correspondence.