Yes. The DTaP in the Pentacel can be counted. Although Pentacel is licensed as a 4-dose series and this may represent a fifth dose of Pentacel (in which case it would be off-label use), the dose of DTaP counts as the fifth dose of DTaP.
The same principle applies to Vaxelis (DTaP-IPV-Hib-HepB, MCM), which is licensed for use in children ages 6 weeks through 4 years as a 3-dose series of vaccinations routinely recommended at age 2 months, 4 months, and 6 months. The DTaP in a dose of Vaxelis inadvertently administered after the 5th birthday or as the 4th or 5th dose of DTaP (off-label use) may be counted as valid and does not need to be repeated.