Agency Republic pitched against two other unnamed agencies to secure the brief.
The win consolidates its position on Diageo's roster; it already handles the Smirnoff and Baileys brands.
The digital marketing campaign for Pimm's will be based on the above-the-line campaign featuring Harry, as played by the actor and comedian Alexander Armstrong, and created by Mother.
It will use digital channels to bring the campaign to life online, allowing consumers to interact with the work.
The digital campaign will form part of a larger push for Pimm's. It will break on the May Bank Holiday weekend and run throughout the summer - the key sales period for the brand. It will run online and on mobile, and integrate with a PR and above-the-line campaign.
Matt Campbell, the brand manager for Pimm's, said: "It's impossible to ignore the dominance of online within our target market, and Agency Republic presented ideas that not only bring our brand to life online, but that will also work across all media."