The influential Reds midfielder is "delighted" after being rewarded for his loyalty to the club with a match against the team he scored one of his most famous and valuable goals
The match against the Greek giants - who Gerrard dramatically netted against in the knockout stages of Liverpool's triumphant 2004-05 Champions League campaign - will take place on August 3 at Anfield.
"I am delighted to be honoured by Liverpool with a testimonial match and particularly thrilled that Olympiakos have accepted my invitation to play the fixture," Gerrard told the club's official website.
"Last time we met proved to be such a memorable game both for me personally and Liverpool.
"I am also especially grateful that Olympiakos 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."
Liverpool will give a portion of the money raised from the match to The Steven Gerrard Foundation, a charity for disadvantaged youngsters, with Olympiakos opting to donate their appearance fee to local Greek charities.