Nodal analysis with two voltage sources
In general, you don't create an equation for node 1.  You take nodes 1, 2 and 3 together as a single node, called a generalized node, aka supernode, for current summing purposes, and create an equation for that.  Like this: Let the voltages at nodes N1, N2 and N3 be called \$v_1\$, \$v_2\$ and \$v_3\$, respectively.  You can sum the currents out of the supernode:
$$
\frac{v_2}{ 2\mathrm{k\Omega}} + \frac{v_3}{ 5\mathrm{k\Omega} }+\frac{v_1}{ 4\mathrm{k\Omega} }= 0
$$
You now have three unknowns and one equation, but you know that \$ v_2 = v_1 - 30 \$ and \$v3 = v1 - 20\$, so you can back-substitute into the previous equation and solve it for \$v_1\$  

Dependant sources are handled in the same manner.