A little-noticed lawsuit details a hacking attack similar to one that stole $81 million from Bangladesh’s central bank, saying cybercriminals stole about $9 million last year from a bank in Ecuador. The case suggests global bankers haven’t been sharing critical information to prevent such heists.

The February 2016 cyberheist involving Bangladesh Bank has elevated concerns about the security of the global financial system in the face of persistent cyberattacks. Details of another bank being victimized more than a year earlier...