Gervais tweeted a link to a clip from The Late Late Show in which Corden gets laughs and applause for a joke about angry social media users that is directly repeated from a well-known part of Gervais' own stand up comedy routine.
The Extras and The Office star captioned it: "The bit about the town square advert for guitar lessons is brilliant."
In the show's monologue, Corden is talking about Elon Musk taking over Twitter and how the social media platform often sees users being angry and posting about being offended on any issue.
He says: "That's what I think when you see Elon Musk talk about Twitter, he says, 'well it's the town square', but it isn't.
"Because if someone puts up a poster in a town square that says guitar lessons available, you don't get people in the town square saying, 'I don't want to play the guitar! I want to play the piano, you piece of s***!'
"Well that sign wasn't for you, it was for somebody else, you don't have to get mad about all of it."
Watch: Ricky Gervais has mocked James Corden over restaurant ban
The joke is exactly the same as one that Gervais, a frequent Twitter user, has already told in one of his stand up routines, with many of his fans sharing his original clip of it.
As a fan commented asking whether Corden had asked to use the joke, Gervais replied: "No. I reckon one of the writers 'came up with it' for him. I doubt he would knowingly just copy such a famous stand up routine word for word like that."
Others who had spotted the joke being used as Corden's commented on The Late Late Show's clip of it to point out that it belonged to Gervais - who is also very well known in the US for his comedy and for having hosted the Golden Globes a number of times.
A viewer tweeted: "I've never seen a more obvious joke steal. There isn't even an attempt to hide it."
Another person added: "I think one of your writers stitched you right up. Good work!"
Corden recently came under fire from the owner of New York restaurant Balthazar, who accused him of being rude to staff - something the star apologised for on The Late Late Show last week.