I've often heard that the Treaty of Nanking was the first unequal treaty. I don't fully understand this definition. Aren't all treaties inherently unequal since the winner gains more than the loser?
You are assuming that treaties must be signed as a result of warfare. That is not the case, treaties can be signed as a result of negotiations. The Treaty of Nerchinsk (1689) between the Qing and Russia was an "equal treaty" in that both the Chinese and the Russians wanted to avoid conflict and thus settled the issue with compromise.
The Treaty of Nanjing is seen as the first unequal treaty because it opened the door to other unequal treaties, ones signed without conflict. After the British gained trading rights in China, other European nations followed suit and pressured the Chinese to open more ports.