The Verdict: Unlikely
We could not confirm that an unmarried partnership counts for this route. Ask the Tribunal Supremo de Elecciones (TSE) in writing whether a declared unión de hecho is accepted; marrying turns it into a clear two-year rule.
Article 14.5 of the Constitution speaks of people who have been married ("casadas") to a Costa Rican for two years. Costa Rican law recognises the unión de hecho for other purposes and one practitioner guide says it is accepted here, but we found no TSE statement saying so. That makes it a long shot rather than a route.
If you marry, the test is two years married and two years living in Costa Rica over the same period. Without either, your own years of legal residence still count towards ordinary naturalisation: seven years, or five for Central Americans, Spaniards and Ibero-Americans by birth.