Monolayer transition metal dichalcogenides offer an appropriate platform for developing advanced electronics beyond graphene. Similar to two-dimensional molecular frameworks, the electronic properties of such monolayers can be sensitive to perturbations from the surroundings; the implied tunability of electronic structure is of great interest. Using scanning tunneling microscopy/spectroscopy, we demonstrated a bandgap engineering technique in two monolayer materials, MoS2 and PtTe2, with the tunneling current as a control parameter. The bandgap of monolayer MoS2 decreases logarithmically by the increasing tunneling current, indicating an electric-field-induced gap renormalization effect. Monolayer PtTe2, by contrast, exhibits a much stronger gap reduction, and a reversible semiconductor-to-metal transition occurs at a moderate tunneling current. This unusual switching behavior of monolayer PtTe2, not seen in bulk semimetallic PtTe2, can be attributed to its surface electronic structure that can readily couple to the tunneling tip, as demonstrated by theoretical calculations.