The sponsorship, which was negotiated by the Omnicom Media Group agencies Drum and PHD, will include broadcast, online and mobile elements when it starts on 7 April.
The idents will be created by McCain’s advertising agency BMB.
The partnership will include product placement, paving the way for McCain products to appear in relevant environments during the programme. McCain will also be able to use the 'Emmerdale' brand in its marketing and in-store promotion.
Mark Hodge, the marketing director at McCain Foods, said: "'Emmerdale' is modern, family-focused and set in the heart of the Yorkshire countryside, providing lots of positive associations with farming and natural, British produce.
"It is a perfect fit for the McCain brand and provides us with a fantastic opportunity to connect with our core target consumer and set ourselves apart from our competitors by communicating the key values of the brand."
'Emmerdale' delivered an average of 7.3 million viewers and a 34 per cent share of the TV watching audience in 2013, regularly beating the BBC’s EastEnders.
McCain replaces Bet365bingo, which signed its own two-year deal in February 2012.