Wayne Rooney scored twice as DC United secured a MLS play-off place with a 3-1 win against New York City.