Prabowo Subianto of Indonesia's Gerindra party pays his respects to Singapore's late former prime minister Lee Kuan Yew on March 28, 2015 ADEK BERRY/AFP/Getty Images

Malaysia and Indonesia have elections coming, and religious parties could play a central role in both. Political Islam is poised to be a defining element of elections in both countries, which are economic leaders in a fast-growing region. The two countries boast significant Muslim populations — Indonesia has the world's largest — and they have histories of pluralism and tolerance. But some political candidates are catering to fundamentalists in order to win over conservative voters, a move that could grant hard-liners greater influence down the line. That's a potentially dangerous scenario for both countries. If extremists are emboldened politically, Jakarta and Kuala Lumpur risk endangering democratic norms as well as their strategic ties with the United States, analysts warn.

Rise of Islamist parties

Conservative sects of Islam have long prospered in both states, routinely fueling debates about the role of religion in government. But radical organizations have never attained national power, Joshua Kurlantzick, senior fellow for Southeast Asia at the Council on Foreign Relations, explained in a note earlier this month.

Indonesia recognizes six official religions and has long operated on a secular philosophy based on the idea of national unity. Malaysia, meanwhile, is a Muslim state but the constitution guarantees freedom of worship for all ethnic groups, which are predominantly Malay, Indian and Chinese. But a growing belief that Muslims are "victims of economic and political injustice" has empowered Islamist entities as of late, risk consultancy Eurasia Group said in a January brief. Represented by names such as Indonesia's Islamic Defenders Front (FDI) and the Pan-Malaysian Islamic Party (PAS), those factions advocate Islamic law, or Sharia, and seek to roll back protections for minorities. Such groups are riding on growing anti-minority sentiment across the region, Eurasia said.

Risky alliances in Indonesia

Some Malaysian and Indonesian candidates running in upcoming elections are looking to capitalize on that attitude as they seek new allies to boost their chances of success. "Political Islam is on an upward swing in both countries, and can be expected to mobilize and deliver voters," said Anthony Nelson, director at consultancy Albright Stonebridge Group's East Asia and Pacific practice. Indonesia's vote — scheduled for 2019 — will likely see incumbent President Joko Widodo, or Jokowi, face off against former Lieutenant General Prabowo Subianto for the second consecutive time. "Prabowo was defeated by Jokowi in 2014, so he has begun to lay the groundwork for expanding his coalition by reaching out to Islamist groups," Nelson explained. Subianto has not yet officially declared his candidacy, but has reportedly allied with the FDI. The group led 2016 Jakarta protests against Christian politician Basuki Tjahaja Purnama. Subianto, who fronts the Gerindra party, is trying to portray himself as more receptive to less affluent Muslims and take advantage of Jokowi's perceived lack of religious credentials, said Vedi Hadiz, professor of Asian Studies at the University of Melbourne. "While Indonesia is predominantly Muslim, there is a narrative that suggests ethnic Chinese and Christians have disproportionately benefited economically from state favor since colonial times," he explained. Representatives at Gerindra did not respond to CNBC's request for comment.

Marina Mahathir sees 'divisions'

It's a similiar story in Malaysia, where an election must be called by August 2018. Prime Minister Najib Razak's ruling coalition — the United Malays National Organisation or UMNO — has been warming to PAS, a group that aims to increase the power of Sharia courts and impose Sharia-based punishments for certain criminal offenses. The alliance claims to represent Malay Muslims and depict detractors as "anti-Malay, anti-Muslim or foreign puppets," according to Hadiz.

Former Malaysian Prime Minister Najib Razak Getty Images