An earthquake with a preliminary magnitude of 5.2 struck off the Kii Peninsula close to Wakayama Prefecture in Japan's southwest, the Japan Meteorological Agency (JMA) said Wednesday.