The number of esquares of idempotents in the rank 2 $\mathcal{D}$-class of $M_n(\mathbb{Z}_2)$.

This is not an answer to the question posed, but is also too long to fit into a comment. I believe that the following lines of GAP code compute the value of $N_4$, $N_5$, $N_6$, and $N_7$. This uses the Semigroups and Digraphs packages for GAP:

S := GLM(4, 2); # The monoid of 4x4 matrices over the field with 2 elements
S := GLM(5, 2);
S := GLM(6, 2);
# Find the first (and only) D-class with row/column rank equal to 2.
D := First(DClasses(S), x -> RowRank(Representative(x)) = 2); 

# The following function creates a bipartite graph from the principal
# factor of D, such that there is an edge from vertex i to vertex j if
# there is an idempotent in the intersection of RClasses(D)[i] and
# LClasses(D)[j], and then counts the number of e-squares using that graph. 
NrESquares := function(D)
  local gr, out, m, count, com, i, j;
  gr := RZMSDigraph(PrincipalFactor(D));
  out := OutNeighbors(gr);
  m := NrRClasses(D);
  count := 0;
  for i in [1 .. m - 1] do 
    for j in [i + 1 .. m] do 
      com := Intersection(out[i], out[j]);
      if Size(com) >= 2 then
        count := count + Binomial(Size(com), 2);
      fi;
    od;
    Print("at ", i, " of ", m, ", found ", count, " so far\n");
  od;
  return count;
end;

According to which $N_4 = 13020$, $N_5 = 4010160$, $N_6 = 1069306560$, and $N_7 = 275635858176$. On my laptop, finding $N_4$ took about 1 second, $N_5$ about 10 seconds, $N_6$ about 3 minutes, and $N_7$ about an hour.

The majority of the computation is finding the PrincipalFactor, which uses a method which works for any (finite) semigroup in GAP. A more specialist method for counting E-squares might be able to do it more quickly.