In the surgical treatment of nonpalpable breast lesions, such as in early-stage cancer, a hook-wire is inserted into the lesion as a marker to enable surgeons to excise the tissue, along with the hook-wire, with a good margin. However, a benchmark technique for intraoperatively determining whether the excised tissue has an appropriate margin around the lesion has not yet been established. In this study, a method for locating a ferromagnetic stainless steel hook-wire inside the excised tissue using a magnetometer is proposed. The magnetometer is placed around a phantom along with the hook-wire at varied locations to map the magnetic field distribution. The three-dimensional coordinates of hook-wire are obtained by executing an optimization algorithm. The experimental results indicate that the location of the hook-wire is successfully obtained. Based on the information regarding the margin around the hook-wire, the surgeon can immediately evaluate the risk of whether some cancer cells still remain in the body.