The Ministry of Justice paid a video production company $23,000 to interview its staff on leadership and film them lip-syncing and dancing to a Justin Timberlake song.
Documents released under the Official Information Act to RNZ show the videos were shown at a staff leadership conference.
The conference allowed staff to talk about their leadership goals and style, the ministry said.
In the lead-up to the October meeting, the ministry employed a video production company to make five videos, interviewing staff about leadership.
Questions included asking staff about a defining experience, when they felt most proud and vulnerable, and their aspirations as a leader.
Deputy secretary for corporate affairs Suzanne Stew said the ministry "decided to take the opportunity" to film a music video.
In a letter to RNZ she said it was a way for employees to "celebrate their connection in an upbeat and informal way".
The video was played at the conference and put on the ministry's intranet.
RNZ asked for a copy of the video but the request was declined on the grounds that staff had not agreed to take part in the video with the knowledge it would be publicly released.
Instead, the ministry agreed for an RNZ reporter to be able to watch the clip.
The video features Justin Timberlake's song 'Can't Stop the Feeling'. It shows staff lip-syncing at the ministry's head office and in corridors.
It also features court security and other court staff dancing in courtrooms. At one point staff form a conga line and dance through the offices.
Ministry of Justice chief executive Andrew Bridgman is also in the video, dancing at his desk and lip-syncing in his office.
A spokesperson for Justice Minister Amy Adams said the minister would not comment because it was an operational matter.