You are referring to the medieval Japanese legal doctrine of
kenka ryō sebai (喧嘩両成敗), literally, in quarrels, punish both sides. The prescribed punishment varied, but use of the death penalty indeed predates the Tokugawa rise to power after 1600.
The earliest example is a law promulgated in April 1445 that mandated beheading.
Starting around the same time, Japan descended into the Sengoku Era, when local officials became conquering warlords. By the early 16th century, the strongest daimyō began to consolidate their domains and issue their own laws, known as
bun koku hō (分国法).
One of the earliest and most famous example is the
Imagawa kana mokuroku (今川仮名目録), a.k.a. Imagawa House Code. It was issued by Imagawa Ujichika in April 1526.
Participation in "fighting" was thus declared a capital offence within Imagawa domains (though the code spared the perpetrators' families and made provisions to exempt minors). Similarly harsh laws became popular in the turbulent Sengoku period, with several other examples including the 1556 Yūki and 1597 Chōsokabe house codes.
All of these examples predate the founding of the Tokugawa Shogunate.
Moreso than outlawing fighting per se (there were plenty of fighting in wars), Sengoku kenka laws forbade the traditional self-redress of grievances. This compelled highly autonomous samurai vassals to appeal to their lieges for justice, rather than take matters into their own hands. In this sense kenka laws were a political tool, used by daimyō and shoguns to consolidate their power through reserving to themselves the sole right to dispense justice - a traditional government function.
A precursor to the
kenka ryō sebai doctrine was a 1352 law issued by the early Ashikaga Shogunate, which laid out punishments for both attackers and defenders in private wars (see below). This grew out of efforts by the earlier Kamakura Shogunate to assert the judicial primacy of government. In these days of relative peace, the punishment were a lot less harsh; usually just forfeiture of properties. Note that the attacker forfeits their entire property while the defender forfeits half.
While common, kenka laws were not universal by any means. For example, the Asakura clan's bun-koku-hō did not seem to have made any mention of this. I believe the Mōri clan only practice kenka ryō sebai during war times, where it is a function of military discipline.
Of course, the law was not always fully enforced. One particularly famous lapse where only one side was punished gave rise to the Japanese national legend of the Forty-Seven Ronin (...no relation to the movie 47 Ronin). The samurai retainers of of Asano Naganori avenged their master (who was ordered to commit suicide) by assassinating Kira Yoshinaka, who went unpunished in a quarrel with Asano.