No, Solidity code (and EVM code in general) is only able to read the current state at the block at which it is being called. If it were able to read state at previous blocks you would need the entire history of the blockchain to validate a block. By not allowing this, the Ethereum developers made it possible to validate a block with only the current state, which is a much less demanding requirement.
In theory it should be possible to construct a Merkle proof that an address had a particular state at a particular block, and pass in the requisite data to allow a contract to verify this proof. That way the caller of a contract could fetch the old data as you do in your example with Web3 and the Solidity code could get that data as a parameter, verify that it was real and act accordingly. However, this probably isn't a trivial thing to do, and I don't know of any examples of it being done.
If you need a history of state at previous blocks the normal solution is to explicitly store this history in contract storage, and add to your history data every time you make a change.