It might-but it'll still swell up some with the temp increase throughout the day. Also, an issue arises with using styrofoam near fuel. When if vents, it'll eat away at the foam.
Just get an OEM tank and be done with it.
In the past year, I've sold and then requested feedback on those who've swapped from aftermarket tanks to Yamaha tanks (since that's all we deal with now is Yamaha). I think about a dozen swaps were done, and got 8 feedback so far. The Yamaha tank does NOT swell much, if any at all and that is genuine customer feedback. Mine is the same way (3 gal)--It sits out in the sun all day in the Arkansas sunshine and I've never noticed much swelling. Perhaps the vent works better, or is it a function of better/thicker material? Dunno. I do know that this little 3 gal tank is heavier than the broken/leaky Attwood 6.6 gal tank that I used to have. Yes the Yamaha tank cost more but thus far (going on 6 years) it's been worth every penny of the difference. Yes I fish the summer days when I ain't working....typically spend most of the day crappie fishing on the local lake. The floor of the deck used to be bare/painted aluminum and it would get so hot that the soles of my shoes would melt.
The attwood tank I used to have swelled up horribly. I called their 'customer service' and mentioned it, they said that they're designed to work like that. Well one afternoon I was out catching a limit of crappie and I started smelling fuel, then hear a light hissing noise. Tank had so much pressure that it broke at the mold seam which obviously poured fuel all over the bottom of the boat. I ain't a smoker but that coulda been a bad deal if I was. That week our Yamaha FSR came through doing his audit and I asked him about the OEM Yamaha EPA compliant tanks and mentioned my ordeal with the attwood tank. Guy said get the 3 gal Yamaha tank for my application and it would be fine. I didn't really believe his because he works for yamaha, figured his opinion was biased, but once again the old guy was absolutely spot on.