"It is a huge honour to be involved in this historic occasion and I am looking forward very much to working with Gary," said Lloyd Webber on his website.
To help create this unique piece of music, Barlow will embark on a journey around the world to discover what The Queen means to the ordinary people of the Commonwealth. His journey will be featured in an hour-long documentary for BBC One.
"This is probably the biggest challenge I've ever taken on musically," said Barlow. "I’m so excited and thrilled to be a part of it."
The star-studded event, which features artists and contributors from the UK and the Commonwealth, will be executive-produced for the BBC by Mirella Breda, executive-produced and directed by Ben Winston and produced by Mark Jones for Fulwell 73.
Lloyd Webber won Original Score Tony Awards for his work on Evita, Cats and Sunset Boulevard. His other Broadway credits include The Woman in White, Bombay Dreams, Joseph and the Amazing Technicolor Dreamcoat, The Phantom of the Opera, Aspects of Love and Starlight Express, among others.
For more information, visit www.bbc.co.uk/diamondjubilee.