For example currently during market close DJIA index has last update time of '5:04 PM EDT'. As we know DJIA is made up of 30 major stocks that trade on NYSE & NASDAQ. I wonder all these stocks trade only till around 4PM EDT which is the closing time for both these exchanges, how come DJIA ends up having a trade time of 5PM EDT or beyond that. I don't believe it has something to do with post market trading as it goes on until 8pm EDT.
Typically the actual index vendors only calculate indexes on a specified time interval (e.g. every 15 seconds, every minute, every 5 minutes, once a day at close etc.) during market hours (9:30-16:00).
Certain intraday data vendors obtain the weightings/index divisors/free float and other factors that are involved in index calculation, and then calculate the index values on a more frequent basis (once a second, once a tick of a constituent etc.).
Such intraday vendors may also provide index values for trades that occur pre- and post-market. That is what you're seeing with your screenshot.
I think the convention is that indices officially close at 4:15 rather than 4:00 pm.
This is reflected in the requirements that options market makers are required to continue to quote options on indices until 4:15 rather than 4:00 (as they have to do for stock). ETFs that represent indexes may also close later.
While the main trading session in the component stocks may have closed at 4:00pm, there may still be sufficient liquidity in the after-hours market until 4:15pm to be able to trade the component stocks. Furthermore, futures contracts also exist on these indices that trade well into the night not just in the US but around the world, even if the underlying securities are not open for trading.
CNBC often take the currently trading futures price and derive the 'fair value' of the market index prior to the open as an indicator of how the market might open when it does.
As far as the 5pm print goes, it could be that the last trade that took place in the ^DJI component stocks in the after hours market occurred at 5pm, or that they may be applying a filter to prevent strange index values from being generated due to illiquidity in the after hours market.
Probably the best way to truly understand the methodology would be to look at the prospectus of a security that is based on the index (for example a DIA ETF), or contact the distributors of index information for a more detailed understanding of their methodology.