The NYSE TAQ set is 'consolidated' meaning that the trades and quotes come from many exchanges, including the NASDAQ system. TAQ has all trades and quotes from the Consolidated Tape / Consolidated Quote, which includes data from the regional exchanges. (See https://www.tradearca.com/marketdata/intermarket.asp for a brief discussion of CTA/CQ and OTC/UTP.)
NASTRAQ is only the NASDAQ system of trade and quotes. In general, the two sets should agree in concept for trades and quotes that execute on NASDAQ, but since they are different systems there will be differences, especially in the details. In general, NASDAQ has more detail about the NASDAQ trades. We do not have a full explanation of the data gathering methods for NASTRAQ however. The NYSE-TAQ manual is fairly extensive and this is a more popular database.
Beginning in 2004, NASTRAQ only includes the trades of NASDAQ Market Makers. In both vintages of NASTRAQ, quotes are either from NASDAQ Dealers ("Dealer Quotes") or the best bid and offer at a particular time ("Inside Quotes"). NASTRAQ does not include the quotes from other exchanges in either vintage of their data. One thing NASTRAQ has that TAQ does not, however, is the Market Maker ID for all Dealer Quotes. So, if you need to identify the source of a NASDAQ quote, NASTRAQ is the place to get it. Unfortunately, this Market Maker ID is not reliably populated in the latest years of NASTRAQ, negating its only major benefit over TAQ.
NASTRAQ has not been updated since 2006 and has been officially discontinued by NASDAQ. It is available on the WRDS website and on the WRDS Cloud Unix system but is no longer supported by WRDS or NASDAQ.