In the book, the party is trying to force people to see it as the only source of truth. It manipulates and changes the truth so that people don't have any way to know what's real. It's in this context that you need to think of this quote.
The quote comes at the end of Part 1, Chapter 7. Winston is thinking that the Party is too strong for him to oppose. But then he thinks that as long as he can hold onto a truth like 2+2=4 then he has a foundation of reality and can resist the Party's attempts to tell him lies.
The connection to the other equation is that later on when Winston is being tortured, he is reminded of this diary entry and is tortured to try to push him toward being able to see that 2+2=5 (which would mean that he would be giving up any hope of having an independent mind).
This quote is taken from Part One, Chapter Seven of 1984 when Winston is talking about the nature of the Party's power over the people of Oceania. He tells us that the Party insist that people "reject the evidence of your ears and eyes" and to believe only what Big Brother tells you to believe. In other words, the Party controls how people interpret truth and reality. So, for Winston, being able to say that two plus two equals four is significant because it represents true freedom and the ability to say whatever one wants to say without fear of violence.
The idea that two plus two equals five is also linked to this concept of true freedom. It suggests that people are so brainwashed by the Party that they will believe anything they are told, even something which is obviously wrong, like that two plus two equals five. By accepting the Party's version of truth, people are forced to give up their freedom, and this is how the Party maintains absolute power.
Because 2+2=5 is what the party says and if you believe anything else you're always wrong and are punished for rebelling against the party. the truth to the matter is that 2+2 is obviously 4 but that is what is called freedom..the ability to express the truth, freely.