【Updated: 】
You cannot get team tokens if you participate in a race using a driver from the opposing team.
Drivers of the team you are supporting have the token icon for their team displayed on them in the driver-selection screen before the race starts.
Bonus Challenges, auto mode, and Coin Rush races are not counted as Team Games, and you cannot get team tokens from them.