viet, you could also look at it this way: for a nitrogen atom to be basic, it must be able to bind a proton (H+), using its electron pair.
In which of these 3 nitrogen atoms is the electron pair more available to be used in such a bond? And why is it less so in the other two?
(This is just a reformulation of what J-bone was trying to tell you.)