With the Black Stars seemingly headed for a goalless draw with Madagascar in their World Cup qualifier, Williams popped up with a 96 minute header to win the tie.
It was a first goal in 11 national team outings for Williams, and saw Ghana end the afternoon in third place in Group I, behind Comoros and Mali on goal difference.
Williams posted on Instagram: God's time is perfect. Thank you all for the support."
Ayew added: "Patience, calm, and believe."
Next up for Ghana is a clash with Comoros in Moroni on Tuesday.