Ayew nodded home Jeffrey Schlupp's free-kick in the 87th minute as the Premier League club finally broke the deadlock amid relentless one-way traffic.
Grimsby defended for virtually the entire game after Andrew Fox was shown a red card in the second minute for a studs up tackle on Andros Townsend that referee Martin Atkinson viewed as a booking only to be over-ruled by the VAR.
Missing their three front line central-backs through injury and suspension, the Sky Bet League Two team would have been forgiven for folding but instead they showed remarkable resilience.
Goalkeeper James McKeown was among the heroes at Selhurst Park but he was ably supported his team-mates as 30 unsuccessful attempts at goal ended when substitute Ayew made the breakthrough.
Palace made nine changes to the side that defeated Wolves 2-0 on Wednesday but retained Wilfried Zaha and Townsend in the hope they would provide the firepower to negotiate what should have been a routine assignment.
But somehow makeshift Grimsby, who were cheered on by a noisy contingent of 5,800 travelling fans, kept their top flight opponents at bay for all but the final three minutes.
An action-packed start saw Fox dismissed and superb chances fall at both ends.
Palace's Alexander Sorloth had a header cleared off the line by Joel Ward before Wes Thomas failed to control the ball when given a one-on-one with keeper Wayne Hennessey.
Also guilty of a poor first touch was Schlupp, who could only find the side netting after being confined to an acute angle.
Sorloth then steered a fine pass wide of the left post with the goal at his mercy before the increasingly overworked McKeown parried a Zaha shot to safety and contributed to saving a frantic goalmouth scramble.
McKeown tipped a deflected Martin Kelly shot on to the post and Schlupp blazed over the crossbar as Palace continued to pour forward.
The theme of Grimsby successfully fighting a desperate rearguard action continued into the second half as Zaha skied the ball into the stands before Cheikhou Kouyate was denied by the post.
Perhaps as a sign of their growing frustration, Palace began attempting long-range shots with Joel Ward and then Townsend failing to trouble the impressive McKeown.
Townsend struck wide once more as the onslaught continued and when the breakthrough finally came it was cruel as the finishing line was in sight, Grimsby allowing an unmarked Ayew to ghost in and expertly finish.