Earnhardt will promote a variety of Sony Electronics products and make personal appearances each year as part of the agreement.
The deal aligns with Sony's pre-existing ties to NASCAR. Sony Electronics has been an active supporter of NASCAR for the past seven years and is the official high-definition TV partner of NASCAR.
" This aligns perfectly with Sony's approach to consumer electronics and makes this partnership especially fitting," said Stuart Redsun, senior vice president of corporate marketing at Sony Electronics, in a statement.
Earnhardt has been selected by race fans as a four-time winner of NASCAR's most popular driver award. He also was selected as the fifth-most-liked athlete in America in Harris Interactive polling in 2006. Earnhardt has been among the top-10-most-liked athletes in the poll for three consecutive years.