No, both parties do not need to agree to the divorce.
Ontario allows for a divorce even if one spouse does not consent, provided that you have been separated for at least one year. However, resolving disputes over child custody, property, or support will require court intervention.