-아/어야 states the condition that has to be met and 이기다 is winning. Most lines here are game rules being explained: 같은 수가 나와야 이긴다 'matching numbers win', 5 이상 나와야 이긴다 'she needs a 5 or higher', 다 다른 걸 말해야 이기는 게임 'a game you win by all saying different things'. One is the proverb-style 적을 알아야 이기지, you have to know your enemy to win.