Yes, using the integral $V = -\int \mathbf{E} \cdot \mathbf{dr}$ to calculate the potential is correct, but the expression - $V(r) = \dfrac{-Ze^2}{r}$ is for the potential energy of an electron in Bohr's classical model of an atom.
$Z$ is just the number of protons in the atom.
You could relate the Coulombic force with the centripetal force for an electron in a hydrogen atom, and get the relation,
$$
E_{kinetic} = \dfrac{1}2 mv^2 = \dfrac{1}2 \dfrac{kZe^2}{r}\tag*{(1)}
$$
And by the Virial Theorem for a spherical system ($n = -1$),
$$
2\langle T \rangle = -1\langle U \rangle\tag*{(2)}
$$
Where $\langle T \rangle$ and $\langle U \rangle$ are the total kinetic and potential energies of the system.
Therefore, substituting $(1)$ in $(2)$ , we have,
$$
U = -\dfrac{kZe^2}{r}
$$