We have developed a scanning tunneling microscope using an optoelectronic switch that gates the tunneling tip current. The switch is fabricated within 30 μm from the tip by photolithography and an accurate cleavage method. We demonstrate this approach by detecting picosecond electrical transients on a coplanar stripline. We have investigated the signal dependence on contact resistance and found significant differences when the tip is brought from low‐ohmic contact into the tunneling regime. In this regime, the THz signal amplitude was found to depend linearly on the tunnel conductance, and disappeared when the tip was retracted.