Well, it is possible, but ...
You should figure at least an hour to clear Customs and Immigration, another 1/2 hour obtaining money and tickets, arranging to store bags and finding the train platform, an hour and a half to Tokyo Station, an hour and half back and at least 2 hours to clear back through to your gate. Add another half hour for contingencies and you would only have about 2 hours in the city. I wouldn't waste the time. There are other options to experience Japan.
The city of Narita is only a few minutes by local train and has a wonderful temple, nice shopping/browsing street, several enjoyable restaurants and plenty of local flavor for a first-time visitor. For this kind of timeframe, the "Narita Layover" page is your friend:
http://www.mgnewman.com/narita/index.html
If you decide you
must try to get into Tokyo, consider traveling by Keisei Skyliner (deluxe train) to Ueno. The Keisei Ueno station is right at the entrance to Ueno Park, with its museums, art galleries, historical monuments and small shrines. Just a half-block away is Shinobazu Pond with its Temple of Benten and the (careful with the spelling) Sh!tamachi Museum. Across the street, Ameyoko arcade is a teeming, outdoor shopping experience that isn't too threatening. Just keep a hand on your wallet. The Skyliner/Ueno option probably shaves almost an hour off the total "gate-to-gate" time, making a trip into town just feasible. Info link:
http://www.japan-guide.com/e/e3019.html
JR