When do lone pairs on nitrogen contribute to aromaticity?
Both nitrogens in your drawing are roughly $\mathrm{sp^2}$ hybridized, therefore they each have a p-orbital and 3 $\mathrm{sp^2}$ hybdridized orbitals. All of the p-orbitals, including those on the 3 carbon atoms in the double bonds, are perpendicular to the plane of the screen (e.g. they project above and below the plane of the screen). So there are 5 p-orbitals and each contains one electron except for the one p-orbital located on your "bottom" nitrogen (in green). This p-orbital contains the nitrogen lone pair, so there are two electrons in this p-orbital.

If we count the p-electrons we have $1+1+1+1+2 = 6$ electrons in $5$ p-orbitals that form a continuous loop. Therefore, the molecule is aromatic ($4n+2, n=1$).

Let's take a closer look at the "top" nitrogen in your drawing (in purple). Where is its lone pair? It resides in an $\mathrm{sp^2}$ orbital on this nitrogen. The $\mathrm{sp^2}$ orbital lies in the plane of the screen. This orbital is orthogonal (perpendicular) to the 5 p-orbitals; therefore these 2 lone pair electrons are separated from the electrons that make the molecule aromatic. They are not involved in the molecule's aromaticity.

Here's how to approach this situation in the future:


Identify the nitrogen(s)
Determine if the lone pair is in a p-orbital or an $\ce{sp^2}$ orbital.  


If the nitrogen is in a double bond, then the lone pair is in one $\ce{sp^2}$ orbital, 1 electron is in the p-orbital and 1 electron is in each of the 2 remaining $\ce{sp^2}$ orbitals.
If the nitrogen is not in a double bond, then the lone pair is in a p-orbital and 1 electron is in each of the 3 $\ce{sp^2}$ orbitals.

Count the electrons in the cyclic p-orbitals to determine aromaticity