The star joined his Take That bandmate to film the Judges' Houses stage of the competition in Los Angeles recently. The pair decided which four singers Barlow would take through to the live shows.
In a fitting tribute to Sinitta's 2009 outfit, the joke was the brainchild of Williams's wife Ayda Field. Barlow was also unaware of how Williams would reveal himself as the guest judge.
"It was hilarious. Gary, the contestants and crew were stunned," a source told The Sun. "Robbie just stood there stark naked apart from these tiny leaves."
They continued: "Ayda has a cheeky side and convinced Rob it would be a good laugh. He was immediately game."
However, Williams did protect his modesty by wearing "naked underwear". The 37-year-old once appeared naked on TV screens in 2003, during the BBC's Comic Relief telethon.
An X Factor spokesperson quipped: "Robbie clearly had nothing to hide from the hopefuls."
The X Factor auditions conclude with a double bill this weekend on ITV1.
> Gary Barlow will be full-on 'X Factor' mentor, says Robbie Williams
> Win a copy of a new biography exploring Robbie Williams and Gary Barlow's friendship
Watch Robbie's nude appearance during Comic Relief from 2003: