Adequate pain control can be achieved using a patient-controlled drug delivery system that can provide analgesia to patients as needed. To achieve this objective, we developed a phototriggered microneedle (MN) system that enables the on-demand delivery of pain medications to the skin under external near-infrared (NIR) light stimulation. In this system, polymeric MNs, containing NIR absorbers and analgesics, are combined with a poly(l-lactide-co-d,l-lactide) supporting array. A "removable design" of the supporting array enables the quick implantation of the MNs into the skin to act as a drug depot, thus shortening the patch application time. Upon irradiation with NIR light, the NIR absorbers in the implanted MNs can absorb light energy and induce a phase transition in the MNs to activate drug release. We demonstrated that lidocaine release can be modulated or repeatedly triggered by varying the duration of irradiation and controlling the on and off status of the laser. Lidocaine delivered by the implanted MNs can be rapidly absorbed into the blood circulation within 10 min and has a bioavailability of at least 95% relative to the subcutaneous injection, showing that the proposed system has the potential to provide a rapid onset of pain relief. Such an implantable device may allow pain sufferers receiving the painkiller without the need for multiple needle injections, and may enable controlling pain more conveniently and comfortably.