A team that comes from behind to win has turned it around. Merriam-Webster:
transitive verb
: to change for the better | turned her life around
If it happens at the last minute, it occurs in the nick of time. Cambridge Dictionary:
In the last possible moment
Indeed, these phrases have occurred together before:
They turned it around in the nick of time winning the final three games of the series to advance to the conference final. (Bleacher Report)
Fusco turned it around in the nick of time, with seven seconds left for the 3-1 championship victory and second consecutive Section II title. (Community News)
World No.1 Karolina Pliskova struggled for the second consecutive match at the 2017 US Open -- and, once again, she turned it around in the nick of time. (WTA)
But Wawrinka turned it around in the nick of time, holding for 4-4, and broke down Kohlschreiber in an eight-minute game of five deuces, eventually converting his sixth break point, 6-4. (The Sport Review)