A novel sandwich-structured nanocomposite based on Ti2NbO7− nanosheets and cobalt porphyrin (CoTMPyP) was fabricated through electrostatic interaction, in which CoTMPyP has been successfully inserted into the lamellar spacing of layered titanoniobate. The resultant Ti2NbO7/CoTMPyP nanocomposite was characterized by XRD, SEM, TEM, EDS, FT-IR, and UV-vis. It is demonstrated that the intercalated CoTMPyP molecules were found to be tilted approximately 63° against Ti2NbO7− layers. The glass carbon electrode (GCE) modified by Ti2NbO7/CoTMPyP film showed a fine diffusion-controlled electrochemical redox process. Furthermore, the Ti2NbO7/CoTMPyP-modified electrode exhibited excellent electrocatalytic oxidation activity of ascorbic acid (AA). Differential pulse voltammetric studies demonstrated that the intercalated nanocomposite detects AA linearly over a concentration range of 4.99 × 10−5 to 9.95 × 10−4 mol L−1 with a detection limit of 3.1 × 10−5 mol L−1 at a signal-to-noise ratio of 3.0.