I think a better comparison would be revenue surely?
GDP is C + I + G + NX. In MSFT 10-K R&D are after the gross profit, so I is there. C attributable to MSFT is sales less costs to avoid double counting. G are taxes which are also there. We should also add D&A and Capex normally as a part of I, but for software companies it's mainly R&D that is allowed to be recognized as cost (which gives huge tax benefits and should stimulate R&D activity, in theory).
Tech is just the latest iteration and these 5 companies are our front runners. Will something else come along and dethrone them? Maybe, who knows.
The only difference i see here is these large companies are generating wealth for a much larger group of people via employment or shares. I'm willing to bet Microsoft and google have made far more millionaires then Rockefeller adjusted for inflation.
Much of these productivity gains due to the scalability of software solutions result in fat margins for those companies, hence the high pay for people in the tech field, but the remainder also goes to the capital owners who get more productive workers.