Nonmetals form covalent bonds with other nonmetals, not ionic bonds. This means you can't use ionic bonding rules to figure out what the structure will be. In fact, there is no way to predict the structure - all you could do is propose Lewis structures for various combinations to predict what it could be.
This is also why there is a special set of nomenclature rules for molecular compounds - it's not enough to just give the names of the elements, you also have to specify the number of each atom.
In your example, if all you are given is N and O, you would have no way of predicting the formula. It could be any one of maybe half a dozen compounds (maybe more). To end up with
$\ce{N2O5}$, you would need to know the name of the compound first.
For binary molecular compounds, the naming rules are pretty easy. First, you need to know the prefixes:
- 1: mono-
- 2: di-
- 3: tri-
- 4: tetra-
- 5: penta-
- 6: hexa-
- 7: hepta-
- 8: octa-
- 9: nona-
- 10: deca-
Then, for each element (starting with the least electronegative one - the one furthest to the left on the periodic table) you just use the prefix in front of the element name. $\ce{N2O5}$ would be called dinitrogen pentoxide.
There are two small details. The first is that we don't use "mono" when there is only one atom of the first element. This means that $\ce{CO}$ is carbon monoxide rather than monocarbon monoxide. The second is that when an element starts with a vowel and the prefix ends in a vowel, we drop the prefix's ending vowel. This means that we say pentoxide instead of pentaoxide.
To find the formula given the name, you just reverse this process.
$\ce{NO}$ - nitrogen monoxide
$\ce{N2O}$ - dinitrogen monoxide
... you get the idea.