The 37-year-old was attacked by a man in a lane between Burn Street and Scott Street in Dalmuir, Clydebank, in the early hours of Saturday.
The attacker ran away when another man shouted. The passer-by then helped the woman to her friend’s house.
Officers said they were gathering CCTV images and examining the scene of the assault.
Detective Inspector Gary Stitt of Strathclyde Police said: “This was a horrific and frightening ordeal for the woman involved, and it’s imperative we trace the man responsible.
“In particular, I would like to speak to the man who came to the woman’s aid. I am sure he will have crucial information.
“The Dalmuir area is a very busy residential area, with people regularly out and about. I would appeal to anyone who may have seen or heard anything to get in touch with us as a matter of urgency.”