The advent of optically pumped magnetometers (OPMs) facilitates the development of on-scalp magnetoencephalography (MEG). In particular, the triaxial OPM emerged recently, making simultaneous measurements of all three orthogonal components of vector fields possible. The detection of triaxial magnetic fields improves the interference suppression capability and achieves higher source localization accuracy using fewer sensors. The source localization accuracy of MEG is based on the accurate co-registration of MEG and MRI. In this study, we proposed a triaxial co-registration method according to combined principal component analysis and iterative closest point algorithms for use of a flexible cap. A reference phantom with known sensor positions and orientations was designed and constructed to evaluate the accuracy of the proposed method. Experiments showed that the average co-registered position errors of all sensors were approximately 1 mm and average orientation errors were less than 2.5° in the X- and Y orientations and less than 1.6° in the Z orientation. Furthermore, we assessed the influence of co-registration errors on the source localization using simulations. The average source localization error of approximately 1 mm reflects the effectiveness of the co-registration method. The proposed co-registration method facilitates future applications of triaxial sensors on flexible caps.