As an efficient geophysical exploration technology, well electromagnetic method is particularly applicable to oil and gas exploration in China's complex terrain areas (deserts, mountains, etc.). A serious influence of topographic relief area on the electromagnetic response of well is inevitable but challenging. To the best of our knowledge, there is no literature on modeling the electromagnetic response of three-dimensional (3D) topography with well electromagnetic method. Based on the domain decomposition, an integral equation method is presented to simulate the electromagnetic response of 3D topography in frequency domain via the well electromagnetic method. Compared with the finite difference and finite element method based on partial differential equation, this method is very efficient in simulating topographic response without huge computation or truncation boundary error accumulation or special boundary condition requirements. Firstly, an induction coefficient is defined according to the topographic relief situation. Then the computational domain consisting of the target body, background medium and 3D topography is divided into reference model, background medium and the distribution of target body medium area. According to the characteristics of each sub-region, Anderson algorithm is an analytic solution based on Gaussian filtering, which is used to provide the primary field from the excited sources in surface. And then, the stable double conjugate gradient-fast Fourier transform is incorporated into integral equation algorithm to obtain the fast 3D terrain shaft frequency domain electromagnetic responses. By comparing the calculation results using the new algorithm presented in this paper with the analytical solutions of Anderson algorithm for half-space model with surface electromagnetic method, the precision and the efficiency of this new algorithm are demonstrated. And the ability to model the electromagnetic responses of 3D topography is shown by comparing with the published results of 3D boundary integral equation. Thus, the high accuracy and high efficiency of the new algorithm presented in this paper are validated. Finally, the influence of 3D valley topography on electromagnetic field response of surface to borehole electromagnetic (SBEM) observation system is presented and analyzed. It is observed that the response of SBEM is seriously disturbed by the field of 3D valley topography which is necessarily removed. The research results presented in this paper are of significance for guiding the identification and correction of electromagnetic topographic effect from 3D SBEM.