Whitebeard and Gol D. Roger were friends, they were shown chatting with each other, Roger even told Whitebeard that his name really is Gol D. Roger and not Gold Roger. Whitebeard said before his death that the One Piece is real, did he know that from Roger? And did he know where the One Piece is?
All we know about it is from Chapter 576 (Episode 485) just in the scene you mentioned:
In a flashback Roger offered Whitebeard to reveals him how to reach Raftel (the supposed location of One Piece), but he replied he was not interested in going there.
So Whitebeard had the opportunity to know where One Piece but his reply to Roger's offer we don't know if he was told the location or not. The One Piece was probably the object of their conversation right before Roger's offer (It seems that Roger has just finished to talk about his adventure): so it seems that Whitebeard was told about One Piece directly by Roger, even if it was never shown explicitly.