Alex Rodriguez hit his first home run of the season as the New York Yankees edged a 5-4 victory over the Detroit Tigers.