A heroic FDNY dispatcher went beyond the call of duty — staying on the phone with an elderly Upper East Side stroke victim for nearly eight hours while rescuers struggled to pinpoint the woman’s location.

EMT Joann Hilman-Payne took the call from Mary Thomas at about 1 p.m. Monday — and kept the line open as emergency responders tried to find Thomas’ address, according to FDNY documents obtained by The Post.

Rescue workers were first dispatched to an East 71st Street address based on a cellphone tower relaying Thomas’ call. But she wasn’t at that location.

That’s when Hilman-Payne and her boss, Lt. Arlene Simmons, sprang into action, according to Emergency Medical Dispatch Capt. Philip Weiss, who wrote a letter to the FDNY on Tuesday asking for recognition for Hilman-Payne and her colleagues.

Hilman-Payne struggled to communicate with the stroke victim, whose speech was badly slurred. The EMT continued speaking to the woman and attempted to keep her conscious.

“Throughout the entirety [Hilman-Payne] worked to keep the patient awake, she never lost her own composure and remained calm while attempting to elicit more information from the patient,” Weiss wrote.

Simmons reached out to the Fire Marshal’s Office for help with the search, according to an FDNY incident report.

While responders tried accessing a previous patient database, Simmons called a list of people with the same name as the patient.

Dispatchers valiantly tried to find a Manhattan address for Thomas, but it would later turn out she didn’t live at the location she was calling from — she was actually working in the apartment as a housekeeper.

Weiss reached out to both Verizon Wireless and the NYPD to help trace Thomas’ cellphone.

The NYPD stepped in and reviewed information from the call — leading rescuers to several Manhattan addresses with no luck finding Thomas.

After several other failed leads, Verizon Wireless security was able to pinpoint Thomas’ location more precisely at about 8:30 p.m. via her cellphone signal.

EMTs were dispatched to an East 72nd Street apartment, where they finally found Thomas.

A doorman at the building told The Post that Thomas is a maid and was working when she fell ill.

She was rushed to Lenox Hill Hospital, where she’s being treated in the Intensive Care Unit.

Hilman-Payne “remained on the phone with the patient for almost eight hours being spelled only briefly for reasons of personal necessity,” Weiss wrote.

“I have no doubt that without the efforts of all involved [Thomas’] outcome would not have been positive,” he added.