The actress will play Gibbs's ex-wife Diane in an episode of the show in November, TV Line reports.
Diane will appear when her current husband ends up getting mixed up in an investigation being carried out by NCIS and the FBI.
However, Gibbs (Mark Harmon) and her other ex, FBI Agent Tobias Fornell (Joe Spano), do not have good relationships with Diane.
McGraw has previously worked on shows such as Men of a Certain Age, Hank, Mad Men, The West Wing, Desperate Housewives and The X-Files.
Other stars who have signed up for appearances in NCIS include Cheryl Ladd, Scott Wolf, Lily Tomlin and Jamie Lee Curtis.
The show airs on Tuesdays at 8/7c on CBS.