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.
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)
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.
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.
We can only extend the 5 west, and with only one possible piece without creating a closed space:
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.
The group of 3 empty squares can't be filled by a single piece, and so the bottom 4 can only extend one way:
That piece in the center-ish must be a T piece:
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:
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:
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!