Peet will guest star in a recurring role as a military lawyer who hires Alicia (Julianna Margulies) as her attorney and the two become friends, reports TV Line.
Peet's storyline features her character suing a contract worker for an attempted sexual assault.
She hires Alicia at Lockhart & Gardner after trying to represent herself in court.
Peet could be joined by her former Studio 60 on the Sunset Strip co-star Matthew Perry on the fourth season.
Perry, who will be seen in the fall on NBC's Go On, previously said that he hoped to return to the CBS series as his character Mike Kresteva, who announced his plans to run for governor of Illinois last season.
The Good Wife will premiere on Sunday, September 30 at 9pm ET on CBS.
Watch a clip of The Good Wife below: