You don't have to win the race. You simply have to finish. Depending on the skill of the competitors relative to yours, though, this can sometimes be difficult (you'll run out of time after the first person reaches the finish).
Using the menu, go to the online app (in-game) and select the Races option. I believe you have to reach a point in Act 1 after a few story missions before online options are available, but I may be wrong. Anyway, sometimes it takes several minutes for the system to find a race, so be patient. But once you're in one, you can pretty much just keep going race after race unless everybody else drops out (it only takes you and one other person to race).
Fun tip: At the finish line, hop out of your car or off your motorcycle, take out a gun, and start shooting at your competition. Good times.
The trophy unlocks after you complete your tenth race, as long as you finish at all.