Simultaneous electrical stimulation and recording using multi-electrode arrays can provide a valuable technique for studying circuit connectivity and engineering neural interfaces. However, interpreting these recordings is challenging because the spike sorting process (identifying and segregating action potentials arising from different neurons) is greatly complicated by electrical stimulation artifacts across the array, which can exhibit complex and nonlinear waveforms. Here we develop a scalable algorithm based on a structured Gaussian Process model to estimate and subtract the artifact. The effectiveness of our method is demonstrated in both real and simulated 512-electrode recordings in the peripheral primate retina, with single and two-electrode electrical stimulation. This technology may be helpful in the design of future high-resolution sensory prostheses based on tailored stimulation (e.g., retinal prostheses), and for closed-loop neural stimulation at a much larger scale than currently possible.