Wales face South Africa in Yokohama on Sunday looking to reach the World Cup final for the first time.
Davies is back in Gatland's XV after missing the narrow last-eight victory over France with a recurrence of an earlier knee injury.
However, Williams is out of this clash and the remainder of the tournament due to a training-ground injury.
Wales reported Williams had suffered the blow to his ankle in an accidental collision and a prognosis was still to be established.
That blow sees Leigh Halfpenny come into the side at full-back, joining Josh Adams and George North in the back three.
— Welsh Rugby Union (@WelshRugbyUnion) October 25, 2019
Wales had already lost Josh Navidi to a torn hamstring against France, meaning Ross Moriarty's inclusion is the third and final change to the side.
Gatland's men will be led by Alun Wyn Jones, who is earning his 142nd Test cap - including nine for the British and Irish Lions.
He moves to joint-second on the all-time worldwide list, tied with Italy's Sergio Parisse behind former All Black Richie McCaw (148).
Gareth Davies gets his 50th cap.
Wales team: Leigh Halfpenny, George North, Jonathan Davies, Hadleigh Parkes, Josh Adams, Dan Biggar, Gareth Davies; Wyn Jones, Ken Owens, Tomas Francis, Jake Ball, Alun Wyn Jones, Aaron Wainwright, Justin Tipuric, Ross Moriarty.
Replacements: Elliot Dee, Rhys Carre, Dillon Lewis, Adam Beard, Aaron Shingler, Tomos Williams, Rhys Patchell, Owen Watkin.
Photo Getty Images. Caption: Liam Williams in training