The John Osborne production will see Sir John play legendary patriarch Billy Rice, with Branagh as Archie Rice.
"I am thrilled to be invited to play Billy Rice in this production of what I believe to be one of the great plays of the twentieth century," the actor said.
It will be the final production in Branagh's Plays at the Garrick season.
"This has been a wonderfully successful season for Ken Branagh and his company, and I feel proud and privileged to be joining them," Sir John added.
Set against the backdrop of post-war Britain, the modern classic conjures the seedy glamour of the old music halls for an explosive examination of public masks and private torment.
"I am really looking forward to working on this play. I find The Entertainer riveting and in my opinion there is no better group of actors to bring it to life," director Rob Ashford said.
The Entertainer will play at the Garrick from 20 August to 12 November.
The show will also be broadcast live to cinemas worldwide, on a date to be announced shortly.

McCarthy, 26, only spent one season at Palace, following a move from QPR last summer, and signs a three-year deal with the Saints.
Pied, 27, played for new Southampton boss Claude Puel for Nice last season, as well as working under him at Lyon.
He has signed a two-year contract with the south coast club.
The Saints have now made four signings this summer, following the arrivals of Nathan Redmond from Norwich and Pierre-Emile Hojbjerg from Bayern Munich.
McCarthy, who only played seven times for Palace, will compete with England international Fraser Forster for a first-team place at St Mary's.
"The club is known for producing young players and they've had successful seasons," the former Reading keeper said.
"There's the Europa League to look forward to this season, so there are going to be a lot of games."
Pied, who can also play on the wing, said: "I am very happy to be able to join this new team. The English league is a very attractive one and it was a goal of mine to be able to play in it."
Sir John Hurt will return to the London stage for the first time in a decade, to star opposite Sir Kenneth Branagh in The Entertainer.
[NEXT_CONCEPT]
Southampton have signed Crystal Palace goalkeeper Alex McCarthy for an undisclosed fee and French right-back Jeremy Pied on a free transfer.