The Otago Rescue Helicopter pilot realised what was happening and pinpointed the location of the culprit.
Stirling continued to shine the laser on a couple more occasions.
The pilot hovered over the address, guiding officers to the scene, the court heard.
Despite fleeing the scene, Stirling was soon apprehended in King Edward St.
He told police he "was just playing with the laser and believed he was shining it at a satellite or drone".
Graeme Gale, managing director of HeliOtago Ltd, the organisation which operates the Otago regional rescue helicopter service, said the pilot had been on a rescue mission bringing a ''seriously sick'' patient to Dunedin Hospital at the time of the incident.
''We've had a number of these incidents in Dunedin, and further South. There's also been a number through the country. For whatever reason, people tend to target rescue helicopters when they're out and about at night.''
Mr Gale said laser strike was ''extremely dangerous,'' and could incapacitate a pilot.
Stirling was remanded on bail until sentencing next month.
Judge Emma Smith ordered a report on the defendant that should assess the viability of an electronically monitored sentence.