We present a construction of 2-step nilpotent Lie algebras using labeled directed simple graphs, which allows us to give a criterion to detect certain ideals and subalgebras by finding special subgraphs. We prove that if a label occurs only once, then reversing the orientation of that edge leads to an isomorphic Lie algebra. As a consequence, if every edge is labeled differently, the Lie algebra depends only on the underlying undirected graph. In addition, we construct the labeled directed graphs of all 2-step nilpotent Lie algebras of dimension $\leq6$ and we compute the algebra of strata preserving derivations of the Lie algebra associated with the complete bipartite graph $K_{m,n}$ with two different labelings.