Short answer is no you can't get the allocation size using an API or OS call. The only way to do it is to track the size of the allocation yourself.
This FAQ discusses it a bit.
The operating system holds a record of all the allocations and their starting addresses. So when you call delete it looks up the pointer you pass in, in its records and then knows what memory needs to be released.
Actually it's the C++ memory manager that knows how many elements are in the array because the destructor needs to be called for each element. OS knows nothing about destructors.
You're right the OS knows nothing about destructors but the destructor calls delete which is an OS call. In fact delete usually calls free like new calls malloc.