The series - from Will & Grace writer Gary Janetti - will star the pair as ageing partners who have lived together in a small Covent Garden flat for nearly 50 years.
Retired actor Freddie (McKellen) and ex-barman Stuart (Jacobi) - joined by their feisty best friend Violet (Frances De La Tour) - now spend their days reading books, walking their dog and bickering.
However, the trio's life together is turned upside down when young man Ash becomes their new upstairs neighbour.
ITV's Myfanwy Moore said: "'ITV is thrilled this exciting and bold sitcom, with stellar performers and writing talent is to join the increasing slate of new-look comedy shows on the channel."
Gary Janetti added: "I'm incredibly excited to be working with ITV and this unbelievable cast!"
Vicious has been co-created by award-winning playwright Mark Ravenhill and will be directed by Red Dwarf's Ed Bye.
> Derek Jacobi, Anne Reid lead BBC romantic drama
> Ian McKellen on 'The Hobbit': 'It's as exciting as Lord of the Rings'