A victory against Iraq next Tuesday, also in Jeddah, would guarantee Saudi Arabia first place in Group B and a seventh World Cup appearance.
In the fourth round of Asian qualifying, only the winners of the two groups of three earn automatic berths to the tournament. The runners-up advance to a fifth round.
Indonesia, coached by former Netherlands and Barcelona striker Patrick Kluivert, struck first when Kevin Diks converted a penalty in the 11th minute. Six minutes later, Saleh Abu Al-Shamat equalised, and Firas Al-Buraikan's penalty in the 37th minute put Saudi Arabia ahead.
Al-Buraikan scored again just after the hour mark, but Diks converted a second spot kick in the 89th minute. Saudi Arabia's Mohamed Kanno was sent off in added time, but the hosts held on for the win.
"It was not a good start, but our reaction was very good," said Saudi Arabia coach Herve Renard.
"At the end ... we were under pressure, but it was our fault to be under pressure because we were supposed to do the job before."
Indonesia's chance of returning to the World Cup for the first time since 1938 will be over if they lose to Iraq, currently coached by former Socceroos boss Graham Arnold, on Saturday.
Earlier in Group A, Qatar were held to a 0-0 draw by Oman in Al-Rayyan.
"We performed well throughout the match against a stubborn team that defended well and closed down spaces," Qatar coach, and former Spain mentor, Julen Lopetegui said.
"Despite that, we created several opportunities but couldn't convert them into goals."
Oman, the only team in the fourth round never to have appeared at the World Cup, play the United Arab Emirates on Saturday.
"A draw is the best result for both teams today. A loss would have hurt our chances of World Cup qualification," Oman's veteran Portuguese coach Carlos Queiroz said.
"We don't have much time before facing the UAE, but we'll prepare well to keep our World Cup dream alive."