Flanagan's unofficial time was 2 hours, 26 minutes, 53 seconds on the 26.2-mile course through all five boroughs.
Mary Keitany of Kenya, who won in New York twice in the past three years, finished second behind Flanagan.
It was Flanagan's first marathon of the year after injuring her back in February. The 36-year-old is a a Massachusetts native who lives in Oregon.
Flanagan had said that if she won on Sunday, it could be her last marathon. She placed second in her marathon debut in New York in 2010 and finished sixth in the marathon in the Olympics in Rio.
American Miki Gorman won the venerable race in both 1976 and 1977.
American Meb Keflezighi, 42, finished 11th in the race Sunday, which will be his last race. He won the New York Marathon in 2009 and the Boston Marathon in 2014.
Click here to follow Daily Voice Rye and receive free news updates.