We studied the photoproduction of dileptons from strong electromagnetic fields generated by the nucleus in relativistic heavy-ion collisions. The production of dileptons is calculated based on the Equivalent Photon Approximation (EPA) method, which depends on the strength of the electromagnetic fields and the density of protons in the nucleus. With the EPA method, we construct the connections between dilepton photoproduction and the electromagnetic form factors in the nucleus. Finally, the nuclear proton densities can be determined with the dilepton photoproduction, which is employed to extract the neutron skin in the nucleus. Our calculations indicate that the dilepton photoproduction varies evidently with different proton densities in the nucleus, suggesting a deeper symmetry underlying the connections between proton density (or the neutron skin) and the dilepton photoproduction. This offers a new way to study the neutron skin in the nucleus.