Will & Grace actor Hayes will appear in a multi-episode arc, according to the show's official Facebook page.
The 42-year-old will play an old musical colleague of former R&B star Ava (Maya Rudolph).
Up All Night airs on NBC in the US and will return to the network with new episodes on September 20.
Hayes previously announced plans for his own NBC sitcom - Us would follow a gay couple who are raising a 12-year-old.
He recently starred in a film adaptation of The Three Stooges - released in the US in April and due in the UK on August 17.
> Will & Grace' star Sean Hayes lands Parks and Recreation role
> Sean Hayes begins work on NBC Western show
Watch a clip from the first season of Up All Night below: