TALK about a friend in need!

“Cougar Town” star Courteney Cox is racing to the rescue of her former “Friends” co-star Matthew Perry.

In a last-ditch effort to shore up his sinking sit­com “Go On,” the beauty will appear with Perry in a special April episode, marking the duo’s first small-screen reunion since “Friends” ended its Emmy-winning 10-season run in May 2004.

COURTENEY WILL PLAY A character who is set up on a date with the grieving widower played by Matthew,” revealed a friend of the stars. “She’s scheduled for only one epi­sode so far, but if viewers tune in, Courteney could be brought back for more. She’s throwing Matt a Hail Mary pass to save his show, and he knows it.”

Perry has struggled to recapture the success he had on “Friends.” And, at first, it looked like “Go On” could be a hit. When it debuted in the fall of 2012, almost 10 million households tuned in to watch his character Ryan King deal with the oddball members of his grief support group following the sudden death of his wife.

“It was considered a great success, but it had a strong lead-in from ‘The Voice,’” said the source, referring to NBC’s super-popular singing com­petition. “Once ‘The Voice’ finished its season, ‘Go On’ slid badly in the ratings and has been going downhill ever since.

“Matt is desperately hoping that Courteney’s appearance will pull his show out of its death spi­ral and breathe new life into it.”