From the Super Mario Wiki
Lucky Stars is one of Luigi's minigames in Super Mario 64 DS. The player must guess which card has the most stars on it. The player begins with ten coins, which means they have ten chances. If the player picks up a card with more stars than the next card that is picked up (Ex.: 5-4, 2-1, 4-1 and so on...) they get more coins. If a card has less than the next card the player picks up, the player loses coins. When all coins are lost, it becomes Game Over.
 In-game instructions
From a pair of cards, pick the one with more Stars to win coins. Beat Luigi at his own game!