What is the oxidation state of nitrogen in N2O5?
It is +5 .Even by the structure.



Notice that it is a resonance structure of:



Now one of the bonds are coordinate bonds where nitrogen donates BOTH its electrons to oxygen (otherwise, oxygen cannot have a single bond without a negative charge and no peroxy type linkage).

So, while determining oxidation state from the structure :

O.N=+2+2+1=+5

References:
https://en.wikipedia.org/wiki/Dinitrogen_pentoxide