試合に負けて勝負に勝つ

Etymology
Literally, "to lose the competition but win the match".

Phrase

 * 1)  to have "won" a match on a psychological or personal level despite losing to all appearances