The 32-year-old, who made his debut for the Reds back in November 1998, has decided upon Greek side Olympiacos as the opponents for the fixture - which will take place on Saturday, August 3 at Anfield.
All the money raised from the match will go to the Steven Gerrard Foundation, while Olympiacos have also confirmed that any proceeds that they make will be given to local charities in their homeland.
"I am delighted to be honoured by Liverpool with a testimonial match and particularly thrilled that Olympiacos have accepted my invitation to play the fixture. Last time we met proved to be such a memorable game both for me personally and Liverpool," he told the club's official website.
"I am also especially grateful that Olympiacos have truly embraced the aim of this match and chosen to donate their fee to charity. I am looking forward to what I know will be a fantastic game and a wonderful occasion."
Gerrard scored as Liverpool defeated Olympiacos 3-1 in the Champions League on Merseyside back in 2004. It was a result that saw the Reds reach the knockout phase and they eventually went on to win the competition for a fifth time.