Downing Street is braced for fireworks as Trump attends a meeting of the NATO military alliance in Britain just days before the December 12 vote.
"I'll stay out of the election," the US leader insisted, adding: "I don't want to complicate it."
Answering questions during talks with NATO chief Jens Stoltenberg, Trump added: "I think Boris is very capable and I think he will do a good job."
The president confirmed he would be meeting Johnson, who is co-hosting the NATO summit. Trump will attend a reception for the alliance leaders at Buckingham Palace on Tuesday evening before Downing Street hosts them all.
But it is not yet clear if the pair will have a one-to-one meeting.
There is speculation Johnson wants to avoid appearing too close to a US president who is deeply unpopular in Britain, with protests planned in central London on Tuesday evening.
Trump denies NHS interest
Opinion polls suggest Johnson's Conservative party is heading for a comfortable win in next week's election, which is dominated by Britain's looming exit from the European Union.
But his team is nervous about any incendiary remarks from the notoriously unpredictable Trump, particularly after a rocky state visit to Britain earlier this year.
The US leader supports Brexit but criticised former prime minister Theresa May's approach, suggesting she give up on trying to get a divorce deal with Brussels.
Trump has since questioned whether Johnson's own Brexit deal would allow Britain to sign a trade deal with the US -- something the Conservative leader holds up as one of the biggest prizes of leaving the EU.
The main opposition Labour party meanwhile has accused Johnson of planning to give US firms access to Britain's much loved state-run National Health Service (NHS) as part of any post-Brexit trade deal.
Labour election rallies routinely erupt into chants of "Not for sale!" and Corbyn has sought to capitalise on Trump's visit to highlight the issue.
But Johnson rejects the claim, saying last week that if Washington tried to include the NHS in trade talks, "we'd walk away".
Trump fuelled the row on his state visit to Britain earlier this year by saying everything would be on the table in a trade deal.
But on Tuesday he insisted: "We have absolutely nothing to do with it and we wouldn't want to if you handed it to us on a silver platter."
The US president also declined to repeat his previous criticism of Labour leader Jeremy Corbyn, after previously telling a British radio station that he would be "bad for your country".
Corbyn has a long history of criticising British and US military interventions, and has been accused of sympathising with proscribed terrorist organisations, from the IRA to Hamas.
Johnson warned on Tuesday that the Labour leader was a security threat, saying that "every time he has the chance, he sides with our enemies".
He told The Sun tabloid that Britain's intelligence allies -- including the United States -- were "very anxious" about working with a Corbyn-led government.
Corbyn described the claims, which come just days after a terror attack in London in which two people were fatally stabbed, as "complete nonsense".
Asked about the Labour leader, Trump again refused to intervene, saying: "I can work with anybody, I'm a very easy person to work with."
Pressed further, he said: "I know nothing about the gentleman, really, know nothing about Jeremy Corbyn."
Corbyn boycotted a royal dinner during Trump's state visit to Britain but is due to attend the reception for NATO leaders on Tuesday hosted by Queen Elizabeth II at Buckingham Palace.
The NATO leaders will on Wednesday gather at a hotel near Watford, north of the capital, for discussions on the future of their alliance, with splits over defence spending and military action in Syria.