No they wouldn't be the same because, the perimeter is adding all sides.
The square has 4 sides so you would add 9, four times.
9 + 9 + 9 + 9 = 36
And a pentagon has 5 sides so you would add 9, five times.
9 + 9 + 9 + 9 + 9 = 45
So, they are not the same.
Hope this helps. :)