A 2-0 victory over Everton, thanks to goals in added time at the end of each half from Aymeric Laporte and substitute Gabriel Jesus, lifted them above their title rivals on goal difference for the first time in two months, having played one match more.
Little over a month ago Jurgen Klopp's side travelled to the Etihad Stadium with the chance to go 10 points clear and Guardiola praised his team's persistence.
"The reality is we could have been, one month ago, 10 points behind when we played Liverpool," he said. "A few days ago we could have been seven points behind. Now we are top of the league.
"That is the best advice. The lesson is never give up. That is a lesson for all athletes. Try to win the games, because life can change immediately."
Of their current position, level on 62 points with Liverpool but with a goal difference seven superior, Guardiola added: "It's much better. We have played one more game. It's the best we can do."