The 30-year-old used to date Diaz, 38, and they are both starring together in the new flick.
Asked how it was working together, Timberlake said to UK newspaper The Sun: 'It's fine. We have to believe there's somebody out there who dated and who are still friends.'
He added: 'We are also both really awesome. I think our only trepidation in doing this movie is that people would make a big to-do about it.
'We just like each other as people and that's never changed. Our mission is not to do anything but just honour that.'
Asked if he thinks their history had a positive effect on their onscreen chemistry, he said: 'Yes, to be honest I think it was a benefit that we knew each other and that we were friends.
'It was a very specific relationship that these two characters had and it was great just walking in and going: 'Oh I really trust that person, I can try every idea and I'll feel safe about it.''