Stock Sale With Margin Balance

I have a margin account with a stock brokerage firm. In my 1099-MISC, the stock broker company listed the entire net gain of the sale. It doesn't include the margin balance paid. I thought it would deduct the margin balance paid from the net gain. Can I adjust my return to reflect the margin balance?

 

For example:

1. I bought 100 shares for $10k.

2. The value of the stock went up to $50k.

3. I used a margin balance of $40k to purchase more shares.

4. I sold all the shares several years later for $100k.

 

The stock brokerage firm reported a net gain of $90K on my 1099-MISC. When I transfer the data to my tax return, the entire $90k shows on my return. My net profit is only $60k. Can I deduct $40k from my net gain when filing my return? If so, where do I enter the $40k borrowed money?