Denis Suarez and Luis Suarez were also among the goals for Luis Enrique's side as they closed to within two points of La Liga leaders Real Madrid.
Massimiliano Allegri's men recovered from their recent defeat to Fiorentina to ensure they stay well ahead of Roma and Napoli with a game to spare.
Fernando Llorente and Roberto Firmino both bagged braces before the Swans' Icelandic forward wrapped up the points in an enthralling second half.
Luis Enrique's side squeezed past the hosts on Thursday, setting the Catalan side up nicely ahead of the reverse fixture next week.
The hosts had the game under control with a two-goal advantage, but lost their focus and were forced into extra time before the midfielder hit home.
Cristiano Ronaldo appeared to have given the visitors three points, but a Ramos own goal and a stunner from the new signing changed everything.
The Toffees picked up a well deserved three points at Goodison Park as they consigned Pep Guardiola's men to a second league defeat in three weeks.
Sergio Pellissier opened the scoring at the San Siro, but the hosts made it five wins in a row through Mauro Icardi, Ivan Perisic and Eder.