Slavery would be a legislative thing and not about war per se. The question would be answered by figuring out where in history a non-slave nation defeated a slave-legal nation (like the Rome question).
In the US, slavery was being outlawed legally and gradually in much of the US and territories with final Emancipation Proclamation by Lincoln coming from his power as Executive in war and occupation. Winning the US war ended slavery here.
Slavery is where one person has exclusive right to another’s labor. When a state requires a person to remain on the land we call it something else (serfdom, communism…). Losing and yielding rights to the State is like slavery but probably better described as something else… IMHO