First I wrote the sentence without an article, than I started to think that maybe "an" is needed. After all, "cake" is countable. On the other hand, I found on the internet many sentences where, in a similar context, there was no article. So, I am a bit confused.
Magda, you're referring to specific cake - the cake that was given away.
If she made an entire extra cake to give away, you can say "She [made two cakes for us to have at the party and] gave an extra cake to the family that wasn't able to come."
OR
There was leftover (extra) cake from the event, in which case, she gave away the extra cake, using in the uncountable sense