It's not a matter of "da" replacing "-n". The accusative is marked with "-n", and any noun phrase headed with "da" is not going to be in the accusative, even if it's part of a larger noun phrase that is.
Mi donas al vi tason da teo. =
I give you a cup of tea.
Kiom da ŝafoj vidas la infano? =
How many sheep does the child see?
Kiom da ŝafoj vidas la infanon? =
How many sheep see the child?