The only way I can think of to do this involves having your program (the one reading) reading all the information in the FIFO -- that is, the read pointer in your program is always at the end of the pipe. When a message is read, you'll add it to an internal list of messages (i.e. a queue or something similar). You'll also maintain a pointer to the last message read.
Reading the last line and discarding all the others, then, is simply the process of following the pointer to the last message and, if desired, clearing the queue.
The problems here are that your internal queue might become large, and that you'll need concurrency control for the queue and last message pointers. I'd have the FIFO reader in its own thread doing nothing but listening to the pipe. When a message comes in, you'll need to lock the queue, add the new message and update the last message pointer, then release the lock. Make sure you process all available incoming messages before releasing the lock. In the thread doing the processing, you should lock the queue to operate on it. Make sure you're locking the queue for no longer than absolutely necessary, or you'll have performance issues.