Khan accused the Tory leadership front runner of having used similar words to those who commit hate crimes.
He said of Johnson: “When you speak to members of the LGBTQ+ community, they will tell you that some of the homophobia they suffered, the attackers used this language, the same sort of language he’s used.
“What I want to see from our prime minister, if it is Boris Johnson, it looks like it will be, is him realising that language matters.”
Johnson has been criticised for remarks including calling gay men “tank-topped bumboys” in a 1998 Telegraph column.
He also attacked “Labour’s appalling agenda, encouraging the teaching of homosexuality in schools, and all the rest of it” writing in The Spectator in 2000.
But in a tweet sent on Saturday, Johnson wrote: ”[I s]alute all those celebrating #PrideInLondon today.
“I have fond memories of my pink Stetson march as Mayor! Britain leads the world in LGBT+ equality and I’ll continue to champion the cause if I am lucky enough to become our country’s prime minister.”
In his speech, Khan said that the “heartbreaking” pictures of a bloodied lesbian couple attacked on a night bus showed the importance of Pride.
Melanie Geymonat and her partner Chris were beaten up by a group of young men for refusing to kiss in May, with the incident sparking public outcry.
Khan said the “huge, huge progress” in gay rights should be celebrated, but added “we must never be complacent”.
This year’s festival comes 50 years since the Stonewall uprising in New York – a moment which changed the face of the gay rights movement around the world.
Organisers expect at least 30,000 people to take part in the parade from Regents Street to Trafalgar Square, with thousands more expected to attend events throughout London over the weekend.