Aaron Judge marked his 1,000th game by hitting his sixth homer of the season and the New York Yankees beat Pittsburgh 9-4 in the Pirates' home opener.