The match against the Greek giant - against whom Gerrard dramatically netted in the knockout stage of Liverpool's triumphant 2004-05 Champions League campaign - will take place on Aug. 3 at Anfield.
"I am delighted to be honored by Liverpool with a testimonial match and particularly thrilled that Olympiakos has 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.
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.
"I am also especially grateful that Olympiakos have truly embraced the aim of this match and chosen to donate their fee to charity," Gerrard said. "I am looking forward to what I know will be a fantastic game and a wonderful occasion."