JAKARTA, Indonesia—Indonesian political parties showed signs Thursday of switching sides and abandoning a challenge by the losing candidate to line up behind new president-elect
Joko Widodo
—moves that would help consolidate his election win if not necessarily make his road ahead any easier.

Members of Golkar, one of the Southeast Asian nation's largest parties, which had backed former army general
Prabowo Subianto
in the two-man race July 9, said the party wouldn't remain in a losing alliance once Mr. Widodo assumes the presidency in October.

"We must change direction, meaning we are not going to be in opposition in the parliament, but will support the government," said
Agung Laksono,
deputy chairman of Golkar, the vehicle that dominated Indonesian politics under the late authoritarian ruler
Suharto.
"Golkar must be realistic in responding to the situation."

More From Indonesia

Mr. Widodo, the governor of Jakarta, was declared winner Tuesday of Indonesia's third direct presidential election, amassing more than 53% of the vote to edge his rival by a margin of 8.4 million ballots. Mr. Subianto's team has said it would challenge the vote in the country's constitutional court, but it has yet to show proof of misconduct, and legal experts say a case would likely be dismissed.

Golkar's repositioning marks a turnabout in a political landscape that had been mostly in place since before the presidential campaign began in June. After legislative elections in April, Mr. Widodo aligned four parties in his camp for the presidential election, giving him a coalition that accounted for 37% of the seats in the legislature.

Mr. Subianto ultimately built a larger coalition of six parties that accounted for 63% of the seats. The grouping rallied to declared a "permanent coalition" last week amid the vote counting, but coalition members say the links are now tentative.

Some pointed to the absence of
Hatta Rajasa,
Mr. Subianto's running mate and chairman of the National Awakening Party, earlier this week when the former general requested a delay in the vote count, and again on the final day of counting when Mr. Subianto said he rejected the process and withdrew campaign members from the count.

On Wednesday,
Bima Arya,
a member of Mr. Rajasa's party, told local media that Mr. Rajasa declined to attend those events because he wanted to deliver a message "to maintain harmony and avoid division."

On Thursday, Messrs. Subianto and Rajasa together with some other coalition members attended a fast breaking, a daily occurrence in the Muslim holy month of Ramadan. Asked about his whereabouts at the key moments, Mr. Rajasa said he'd been absent from activities because of the birth of a grandchild.

Broader support will help tighten Mr. Widodo's hold on the presidency amid Mr. Subianto's challenges, to the relief of markets that have been topsy-turvy in a messy end to the campaign season, analysts say. The main index of the local stock exchange closed 0.1% higher Thursday.

"The quicker [Mr. Widodo] consolidates his grip, via securing support from restive opposition parties, the better chance market sentiment has in dismissing the noise" of Mr. Subianto's legal challenge, OCBC economist
Wellian Wiranto
wrote in a research note.

It could also give Mr. Widodo tacit majority control of parliament, cooling fears that frustrated parties will mount gridlock opposition to presidential initiatives. The current parliament often blocked President
Susilo Bambang Yudhoyono,
who steps down in October after serving a maximum 10 years.

Coalitions in Indonesia are famously loose groupings in which parties often part ways on major issues.

When Mr. Yuhoyono tried to cut fuel subsidies in 2012—which economists say will be one of the most pressing issues for Mr. Widodo when he enters office—he was blocked by opposition from two parties in his coalition. Fuel subsides have threatened to break the budget in recent years amid an expanding consumer class, but they're also popular among millions of voters.

To forge progress on issues like subsidies, Mr. Widodo will effectively have to build a coalition of partners each time.

"Golkar will always be Golkar," said one high-ranking member of the party. "It's the country's oldest party and today its second largest in parliament. It will always act on its interests."