I think it's impossible to give a definitive answer to that question.
The controlling norm is the Schengen Borders Code, specifically article 5:
For the purposes of implementing paragraph 1, the date of entry shall be considered as the first day of stay on the territory of the Member States and the date of exit shall be considered as the last day of stay on the territory of the Member States. Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States.
I don't think it unambiguously answers your question one way or the other. As all languages have equal weight, I also checked the German and French versions of the regulation and they are similarly ambiguous.
The strongest evidence that this sentence should be interpreted in a specific way would be a ruling of the EUCJ but as far as I know it never had to decide on this particular issue.
And of course, with no entry or exit stamps at internal borders, enforcement would be nearly impossible, but that's obviously a distinct question.