We present a lattice calculation of the neutron and proton electric dipole moments (EDMs) with $N_f=2+1$ flavors of domain-wall fermions. The neutron and proton EDM form factors are extracted from three-point functions at the next-to-leading order in the $theta$ vacuum of QCD. In this computation, we use pion masses 0.33 and 0.42 GeV and 2.7 fm$^3$ lattices with Iwasaki gauge action and a 0.17 GeV pion and 4.6 fm$^3$ lattice with I-DSDR gauge action, all generated by the RBC and UKQCD collaborations. The all-mode-averaging technique enables an efficient and high statistics calculation. Chiral behavior of lattice EDMs is discussed in the context of baryon chiral perturbation theory. In addition, we also show numerical evidence on relationship of three- and two-point correlation function with local topological distribution.