The video for the US pop star's song Opalite was released on the Apple Music and Spotify streaming platforms on Friday afternoon.
Rumours of Gleeson's participation in the project began after pictures of promotional billboards for the track appeared on social media a few hours before its release.
In the almost six-minute video, which Swift also directed, she and Gleeson play love interests dubbed 'lonely woman' and 'lonely man'.
Before the release on Friday, the singer's legion of fans had circulated a clip of the pair appearing together with Oscar-winning Cork actor Murphy on The Graham Norton Show in October.
During their interview, Swift complimented Gleeson's performance in the sitcom The Paper, saying she "loved" the show.
Murphy then quipped: "It's worth watching for Domhnall's dancing alone".
To which Gleeson replied: "I'm hoping to get into a Taylor Swift music video".
This elicited an astonished and surprised look from the US singer.
Writing on X, Swift explained that Irish actor Gleeson had "made a light-hearted joke about wanting to be in one of my music videos" while on the show, which led her to be "instantly struck with an idea".
Swift wrote: "I had this thought that it would be wild if all of our fellow guests on the Graham Norton show that night, including Graham himself, could be a part of it too.
"Like a school group project but for adults and it isn't mandatory. To my delight, everyone from the show made the effort to time travel back to the 90s with us and help with this video."
In the video, talk show host Graham Norton plays a salesman, with Murphy appearing on billboards and advertisements and providing a voiceover.
Clips from the Graham Norton Show feature at the end of the video, including the exchange between Swift, Gleeson and Murphy.
The other guests on the episode – actresses Greta Lee and Jodie Turner-Smith, and Scottish singer Lewis Capaldi – also appear in the music video.
Opalite is the second single from the record-breaking album The Life Of A Showgirl, which was released on October 3.
The singer said she wrote it about her fiance NFL player Travis Kelce, whose birthstone is opal.
Swift brought her Eras Tour to Dublin win June 2024 when she played three sold-out gigs at the Aviva Stadium.
