The duo, who previously worked together on Doctor Who, have joined the cast of Love Life.
The project, written by Dive scribe Dominic Savage, is made up of five overlapping stories examining love. The instalments will all be partially improvised.
Tennant's episode, which will also star This Is England '86 actress Vicky McClure, will focus on a happily married man who is thrown when his first love returns to his life.
Elsewhere, Piper will play a teacher who is disappointed with her relationship with a married man. She ends up becoming attracted to one of her female pupils.
Meanwhile, Jane Horrocks will star as a woman who discovers that her husband is having an affair, and then meets someone she is attracted to.
Outcasts star Ashley Walters will play a bored young man who feels pushed out when his wife has a baby, but then falls for a woman he sees in the street. Finally, David Morrissey will play a divorced man who is optimistically looking for love.
"I am looking to create something special that has a modern view on the age old mystery of love," Savage said. "Something that expresses the reality of love and puts it on the screen. I am looking to explore these themes in the seaside town of Margate, with a group of incredibly talented actors who are ready to journey with me on this."
The BBC's controller of drama commissioning Ben Stephenson said: "This is a complete first in TV drama on BBC One - a serial made through improvisation. It features some of our very best acting talent working in a way we've never seen on screen from them before, using improvisation to push the boundaries of each story, to get right to the heart of the truth."
> David Tennant denies 'Doctor Who' romances
> Read more TV news