Magnitic Anomaly Device (MAD) was also used by the allies. It was deployed on the USN's PBM series of patrol flying boats. The USN also deployed airborne radar in the search of German subs.
this was taken by Wiki
Magnetic anomaly detectors employed to detect submarines during World War II harnessed the
fluxgate magnetometer, an inexpensive and easy to use technology developed in the 1930s by
Victor Vacquier of
Gulf Oil for finding ore deposits.
[2][3] MAD gear was used by both Japanese and U.S. anti-submarine forces, either towed by ship or mounted in aircraft to detect shallow submerged enemy submarines. The Japanese called the technology
jikitanchiki (磁気探知機, "Magnetic Detector"). After the war, the U.S. Navy continued to develop MAD gear as a parallel development with sonar detection technologies.
So it isn't a leap to believe that the Japanese used a similar devices