Usually, an Estonian residence permit allows you to travel freely to other Schengen countries, including Finland. The 183 days 'grace period' granted by Estonian authorities, allowing you to stay in Estonia after the expiration of the residence permit does however only apply to Estonia. You are with your expired residence permit not allowed to travel to other Schengen countries. When travelling from Estonia to Pakistan with transit in Finland, there will be no immigration control between Estonia and Finland, but you have to go through an immigration checkpoint in Finland when leaving the Schengen area. With an expired residence permit, Finnish border police will likely assess that you have overstayed.
Your easiest solution to the problem is to 'formalise' the grace period by the Estonian immigration authorities. For a 30€ fee, you will be issued a regular type D visa for the remaining grace period, which will allow you to travel to other Schengen countries as well and allow you to transit Finland on your way back to Pakistan. You can get current information on how and where to apply for a formalisation from the Police and Border Guard.