The photo shows Swift and Timberlake partying alongside married megastars Jay Z and Beyonce.
"Happy Birthday, @jtimberlake! Thank you for your music, comedy, daaaahncing, songwriting, and for taking this selfie," Swift tweeted Saturday to her 51.7 million followers.
Timberlake also celebrated his 34th birthday with a message on social media. He announced on Instagram his wife Jessica Biel is pregnant with their first child.