Cindy McCain announced her support for Mr Biden in a tweet on Tuesday, saying he was the only candidate “who stands up for our values as a nation.”
Mr Trump tweeted that he was “never a fan” of the veteran Republican senator, who died in 2018.
Mr McCain was one of the president’s most outspoken Republican critics.
Mr Trump, in turn, publicly questioned his heroism during the Vietnam War.
In her tweet on Tuesday, Mrs McCain said while her husband and Mr Biden had some “passionate arguments” and while she did not “always agree on the issues” with the Democratic presidential candidate, “he is a good and honest man”.
In response, President Trump said she “can have Sleepy Joe!” – a nickname the president has for his rival.
He also accused Mr Biden of being Mr McCain’s “lapdog”, denouncing “bad decisions on endless wars”.
“I hardly know Cindy McCain,” he added, “other than having put her on a Committee at her husband’s request.”
Cindy McCain made an address at the Democratic National Convention last month, and her endorsement may prove a hindrance to President Trump, who is trailing Mr Biden in most national polls.
Mr Biden has since thanked her, saying on Twitter that he was “deeply honoured” to have her support and friendship.
Mr McCain was the Republican party’s presidential candidate in 2008, and a senator for Arizona, a key battleground state in November’s elections.