The duo, who starred in Greek together until it ended last year, will appear in the same episode of the CBS drama, TV Line reports.
They will both play technicians in Mac's lab who end up being questioned when one of their colleagues is killed.
Grammer also previously starred in As The World Turns, while Hill has had guest roles in shows such as Criminal Minds, CSI, Community, How I Met Your Mother and Breaking Bad.
The pair's episode of CSI: NY is due to air in the spring.
The show returns with a new instalment on CBS on Friday.
> Read more TV coverage