The bout will take place during the televised event at SAP Center. UFC officials confirmed the news on Friday.
Thomson (20-6) is coming off a controversial split-decision loss to Ben Henderson in January, during which he suffered a thumb injury that required surgery. Thomson, 35, hinted at a potential retirement after the fight but ultimately decided against it.
Fighting out of the American Kickboxing Academy in San Jose, Thomson is the No. 6-ranked lightweight in the world according to ESPN.com. The former Strikeforce champion has alternated wins and losses in his last six bouts.
Johnson (15-8) will look to continue a recent surge that has him on a three-fight win streak.
A former contestant on "The Ultimate Fighter reality series, Johnson has compiled a 7-4 record in the Octagon, including three knockouts. He is coming off a unanimous decision win over Melvin Guillard in March.