A suspected attempt to hack into the Democratic National Committee’s voter database was actually a cybersecurity test, the organization said.

The DNC, which was hacked by Russian intelligence officers during the 2016 presidential campaign, said Tuesday that it had contacted the Federal Bureau of Investigation after being alerted to an apparent phishing scheme by the computer security firm Lookout Inc., which uncovered a replica of the login page to the DNC’s VoteBuilder database during an online scan.

In...