Ali is the first Muslim actor to take home the golden statue. And he comes from a sect of Islam, Ahmadiyya, that has faced persecution and violence.
Ali did not mention his Muslim faith during his Oscars acceptance speech for his role in "Moonlight," in which he plays a kind-hearted Miami drug dealer who becomes a father figure to a boy who is struggling with his sexuality.
But while accepting a Screen Actors Guild Award last month, Ali talked about his conversion to Islam and what it has taught him.
"I think what I've learned from working on 'Moonlight' is we see what happens when you persecute people. They fold into themselves. And what I was so grateful about in having the opportunity to play Juan was playing a gentleman who saw a young man folding into himself as a result of the persecution of his community," Ali said.
"Taking the opportunity to uplift him and to tell him he mattered, he was OK and accept him -- I hope that we do a better job of that," he said, instead of focusing on "the details that make us all different."
Son of a minister
Ali was born Mahershalalhashbaz Gilmore and raised as a Christian in Oakland, California.
"My mother is an ordained minister. I'm a Muslim. She didn't do backflips when I called her to tell her I converted 17 yrs ago," he added.
"But I tell you now, you put things to the side, and I'm able to see her and she's able to see me. We love each other. The love has grown. And that stuff is minutia. It's not that important."
When Ali was in graduate school he began to "question the divinity of Jesus" and "why I was taught, told, and instructed to pray to Jesus, instead of God," he wrote in a book titled, "Short Stories by American Converts to Islam."
Ali said he was introduced to a mosque by a friend and was interested in converting. But still, he had some reservations.
"And to be quite honest, I was concerned that it might be a cult," Ali wrote in the book.
Members of the Ahmadiyya sect, also known as Ahmadi Muslims, are sometimes viewed as non-Muslims because they do not consider Mohammed as the last prophet sent by God.
But after he met members of the Ahmadiyya community, Ali said that sect of Islam made the most sense to him.
For example, since the actor travels often for work, non-Ahmadi Muslims told him he would need to lay down a rug in the middle of a plane's aisle and pray mid-flight. The Ahmadi sect said he could pray while seated.
Because of their beliefs Ahmadis have faced persecution from fundamentalist Islamic groups.
One of the deadliest days for Ahmadis came in 2010, when terror attacks that targeted Ahmadi mosques killed 98 people
in Lahore, Pakistan.
Julie Lenarz, director of the Human Security Centre in London, said Ali's Oscar triumph marks a victory for a sect that is often harassed.
"Congratulations to Mahershala Ali, first Ahmadiyya Muslim to win an Oscar - a denomination brutally persecuted for being not 'true Muslims,' she tweeted.