Answer:

Solution:
Step 1:
The point of entry is the 9. Not all of its four sides and be filled because then the 9 itself is isolated. So at least one adjacent square of the 9 is empty, meaning the other three branches are full. If the north and west branches were full, then there would be a closed space. Thus, either the north or west adjacent squares must be empty. This implies both the south and east branches are full.

Step 2:

The marked square must be yellow, i.e. empty. If it were not, then since the 5 isn't satisfied yet, either the west or east adjacent square is filled as well. Believe it or not, this creates a closed space!!! (See below)

Step 3:
We begin a long proof-by-contradiction. Assume the marked square is gray:

Then all of the following must be apparent:

If the square west of the 5 was filled, then the piece taking up that square would inevitably create a closed space somewhere. So it must extend eastwards:

This is absurd. Contradiction. Thus the marked square was empty.

Step 4:
If the square south of the leftmost 4 were empty, the entire east branch must be filled, contradicting the 2. So it must be filled, completing an entire tetromino.

Step 5:
We can only extend the 5 west, and with only one possible piece without creating a closed space:

Step 6:
We must extend east from that 4:

We used up both L pieces, so the only piece that can complete this section is the Z piece.

Step 7:
The group of 3 empty squares can't be filled by a single piece, and so the bottom 4 can only extend one way:

Step 8:
That piece in the center-ish must be a T piece:

Step 9:
If the branch north of 6 extended 3 squares, it would create a closed space somehow. Similarly, if it extended 2 squares, it would inevitably create a closed space. So it is as most 1 square in length. Because of math, this implies that the eastward branch is at least 2 squares long:

Step 10:
As it turns out, this branch must be exactly 2 squares in length. If it were 3 squares, then this is a contradiction because the last piece that has a 3-square base must be used for the 9 in the top-left corner. If it were 4 squares, this contradicts the 6.
Since this implies that the square north-adjacent to the 6 must be filled, this completes the piece:

Step 11:
The 2 at the bottom can only be satisfied by an O piece. The 1 at the top can only be satisfied by the T piece.

There's only one way to fit the rest:

Really nice puzzle!