In general, one can explicitly compute this by solving polynomial equations in the entries of the linear map $f:L\rightarrow L'$ arising from the condition
$$
[f(e_i),f(e_j)]_{L'}=f([e_i,e_j]_L)
$$
for a basis $(e_1,\ldots ,e_n)$ of $L$, together with the condition $\det(f)\neq 0$.
In low dimensions, it is indeed possible to solve such equations. If all obvious invariants are equal and we don't see an obvious isomorphism, then we have to do such a computation.
For example given two $7$-dimensional nilpotent complex Lie algebras $L$ and $L'$ of the same nilpotency class, we usually do not find easy invariants distinguishing them (often the adjoint cohomology $H^p(L,L)$ is a good invariant, but it is also not so easy to compute it). Then
we can quickly decide whether or not they are isomorphic by the above computation.
You are correct that (3) is nilpotent but (2) is not, and hence they are not isomorphic.
When you calculated that the Lie algebra $\mathfrak{n}_3$ in (3) is nilpotent ($\mathfrak{n}_3$ is called the Heisenberg algebra), you computed that its derived Lie algebra $[\mathfrak{n}_3, \mathfrak{n}_3]$ is
$$[\mathfrak{n}_3, \mathfrak{n}_3] = \left\{\pmatrix{\cdot&\cdot&b\\&\cdot&\cdot\\&&\cdot} : b \in \Bbb R \right\} \cong \Bbb R .$$
This suggests computing the derived Lie algebra $$[\mathfrak{g}, \mathfrak{g}]$$ for the Lie algebras in (1) and (4) and comparing them to those of (2) and (3), which recovers Lord Shark the Unknown's hint in the comments.
It is not true, by the way, that the Lie algebra $\mathfrak{t}_2$ in (2) has dimension $2$; it has dimension $3$, since it has basis
$$\left\{\pmatrix{a&\cdot\\&\cdot}, \pmatrix{\cdot&b\\&\cdot}, \pmatrix{\cdot&\cdot\\&c}\right\} .$$ Putting your intuition more precisely: The inclusion map $\mathfrak{t}_2 \hookrightarrow \mathfrak{gl}(2, \Bbb R)$ is a $2$-dimensional representation of $\mathfrak{t}_2$, whereas the inclusion map $\mathfrak{n}_3 \hookrightarrow \mathfrak{gl}(3, \Bbb R)$ is a $3$-dimensional representation.
Finally, it was mentioned in the comments, but for a matrix $x \in \mathfrak{gl}(n, \Bbb R)$, $x^t$ just denotes transpose of $x$.
(In the last two comments, we used the (canonical) identification of $\mathfrak{gl}(n, \Bbb R)$ with the space $M(n, \Bbb R)$ of $n \times n$ matrices, equipped with the usual matrix commutator as Lie bracket.)
Best Answer
If you are happy with one of them being abelian, take an abelian one, and a non-abelian one.
For instance, in dimension $2$, take $L_{1}$ to have a basis $a, b$, and $[a, b] = b$.
If you want both of them to be non-abelian, go to dimension $3$, and take $L_{1}$ to have a basis $a, b, c$ with $$ [a, b] = b, [a, c] = [b, c] = 0 $$ and $L_{2}$ to have a basis $a, b, c$ with $$ [a, b] = c, [a, c] = [b, c] = 0. $$ The two algebras are not isomorphic, because in the second one every commutator $[[x, y], z]$ is zero, which is not the case with the first one.