Both Cook and England had suffered a year-long run of poor form, but his innings of 95 and 70 not out helped them end a 10-match winless run.
"It was getting to a crux situation," said Cook, who had averaged 22.10 with the bat over the previous 10 Tests.
"If it had carried on like that who knows what would have happened?"
He added: "One game does not change everything and we know how important my runs are from the top of the order. I don't know if my captaincy got dragged into it but when you are losing there will be focus on it."