ROME—An antiestablishment movement’s candidate won the largest share of votes in the first round of Rome’s mayoral election, adding to the advances of populist parties across Europe and posing a fresh test to Prime Minister Matteo Renzi’s ruling center-left party.

The candidate for the upstart, euroskeptic 5 Star Movement, 37-year-old lawyer Virginia Raggi, won 35.6% of the vote cast Sunday in Rome, according to almost final data. Roberto Giachetti, the candidate for Mr. Renzi’s Democratic Party, received 24.7%. The two will...