The work describes a new electrochemical method of assaying natamycin in pharmaceutical preparations and food products. The proposed procedure involves the use of cathodic-conditioned boron-doped diamond electrode (BDD) and sensitive electrochemical techniques. Well-defined oxidation peaks of natamycin, but no reduction peaks, were obtained in cyclic voltammetry. The sensitivity of the obtained measurements was significantly improved when a surfactant, sodium dodecyl sulfate (SDS), was present in the supporting electrolyte solution. The method of square-wave voltammetry was used to determine the linear relationship between the current and natamycin concentration. The linear relationship was obtained in the concentration range from 9.75 × 10−8 to 1.16 × 10−6 mol·L−1. In optimum conditions, i.e., 0.05 mol·L−1 H2SO4 containing 5.07 × 10−4 mol·L−1 SDS at the potential of 0.81 V (vs. SCE), the limit of detection was 3.1 × 10−8 mol·L−1. The method has good precision, which is proved by low relative standard deviation (approx. 1%). The obtained values of recovery prove the accuracy of the proposed procedure. The developed procedure was successfully tested for the assay of natamycin in single-ingredient and multi-ingredient pharmaceutical preparations and in wine samples.