The Champion of the World also conquered the hearts of New York City.

From bouts at Madison Square Garden to marching in the streets of Harlem, Muhammad Ali, who died Friday in Scottsdale, Arizona, at the age of 74, left an indelible legacy on the New Yorkers he touched.

The greatest fighter in the world — and also an outspoken proponent of peace, tolerance and civil rights — connected with a city that, like him, is bombastic, progressive and invincible.

“It means the world,” to know that his childhood hero trained where he now works as a trainer, at Gleason’s Gym, said Darryl Pierre, 59.

Ali trained at Gleason’s when it was still located in the Bronx, for the heavyweight championship title he would wrest from Sonny Liston in 1964, an upset that shocked everyone and bankrupted bettors. The boxer continued stopping by even after he retired from the ring and the gym relocated to DUMBO, said owner Bruce Silverglade.

Alice Fleetwood, 61 of Harlem, recalls seeing Ali marching with the Nation of Islam on 125th Street after he refused to be drafted into Vietnam.

“The effect on the crowd was just overwhelming happiness,” said Fleetwood, who was also electrified by the boxer’s charisma and aura of strength. “Here is this Black person standing up for what is right and what he believes in! He showed us a whole different attitude — that the people in our culture could stand up! He was a Black man who moved America” and prompted a critical examination of all assumptions, said the social services manager.

Malcolm X, minister of Temple #7 in Harlem, and Ali — the first celebrity to join the Nation of Islam — provided a new symbol of black masculinity that challenged the racial status quo, observed Khalil Muhammad, director of the Schomburg Center for Reseach in Black Culture.

After a Harlem riot in 1964 — the same year Ali joined the Nation — he was a part of the transformation to give young men of color “an entire new way of life that the civil rights movement couldn’t offer at the time,” said Muhammad.

After Ali was diagnosed with Parkinson’s disease in 1984, he used his celebrity to help New Yorkers with disabilities — and not just by fundraising — observed Edith Prentiss, the vice president of legislative affairs for Disabled in Action.

Before Ali, celebrities with prominent disabilities “faded into the woodwork. . . . He acknowledged his disease process and how it impacted his life,” raising awareness of and money for Parkinson’s, destigmatizing physical differences, and proving by example that people with disabilities should not be marginalized, said Prentiss.

Ali did not let the wages of his disease, which slowed and slurred his speech, stop him from expressing himself on matters of importance, though his tone and oratory became tempered with age. After 9/11, Ali and actor Will Smith — who famously played him in the movie, “Ali,” released that December — released a video to calm the hysteria then gripping the nation.

“Islam is peace!” inveighed Ali, speaking determinedly, but with difficulty. “It’s against killing and murder. The terrorists and people doing it in the name of Islam are wrong and if I had a chance I’d do something about it,” he said.

Some years ago, Ali “came to the 100 Blacks in Law Enforcement (Who Care) fundraiser in Downtown Brooklyn,” recalled Derrick Nesby, 54. “Even though he couldn’t talk, you could really feel his presence,” recalled the Crown Heights resident.

Nesby, now an outreach coordinator for a ministry, joined the Nation of Islam himself as a teenager in emulation of his childhood hero, before becoming a Christian in his 30s.

Nesby credited Ali for “opening so many doors,” for people of color and helping fighters to “earn a decent living. He demanded they be paid more for fighting – for us killing each other really,” he said with a sigh, referencing the head injuries legion to the sport.

Ali visited schools in Harlem and elsewhere, invited P.S. 175 to Madison Garden in 1967 to watch him train for his bout with Zora Folley, and appeared at various NYC fundraisers.

But his message of perseverance into excellence was what many New Yorkers took most to heart. Marlene Henry, 53, recalls meeting Ali at his Deer Lake Training Camp with other pageant contestants in 1980, during her reign as Miss Guyana. “He kept talking about winning a fight,” and told the Caribbean contingent, “you can win this pageant, too!” said Henry, who lives in Brooklyn. The message, she said, was “you can do what you wanted to do in life” if you just keep trying.

“I wish the younger people locked up today would look at him and learn how to live their own dreams,” added Henry, who now works as a correctional officer.

A man of the world, Ali’s message resonated deeply in a city of immigrants.

Mokarram Ahmed, 50, a labor standards investigator from Woodhaven, met The Champ when Ali came to inaugurate the South Asian Federation Games in Islamabad, Pakistan, where Ahmed was playing table tennis for Bangladesh in 1989.

“He had visited Bangladesh in 1978 (seven years after it established its own independence) and was given honorary nationality,” recounted Ahmed, who recalled Ali’s conversion to Islam — and his refusal to fight in Vietnam — as thrilling the Muslims of Southeast Asia.

Recognizing the flags Ahmed and his colleagues were wearing, Ali engaged them in an amusing conversation comparing the requirements of table tennis and boxing. Unlike many athletes, Ali was also a thinker, a humanist and “very, very open minded,” and exceptionally “gentle and accommodating,” to his fans, showing an obvious love of all children, Ahmed recalled.

His message continues to resonate and instruct.

“The one thing I learned from him is that you get back up, you fight for what you want,” said Absar Alam, 22, of Bensonhurst, a spokesman for Ahmadiyya Muslim Youth Association. “When you fall down, you learn from your mistakes, you get better (and) you reforge yourself.” (With Wendy Lu and Alison Fox)