The 7 May performance of The Vote at the Donmar Warehouse in London will be broadcast live on the More4 channel.
Described as "a real-time play for theatre and television", it is the latest work by playwright James Graham.
Graham previously wrote Privacy, about internet security, for the Donmar and political drama This House for the National Theatre.
He has also written a 90-minute drama for Channel 4 about the formation of the Conservative-Liberal Democrat coalition in 2010.
Josie Rourke, the Donmar's artistic director, will direct The Vote, which will run on stage from 24 April to 7 May.
The play will be set in a fictional London polling station and the theatre said tickets to see the "bold experiment" in person would be made available via a ballot.
Other highlights of the theatre's 2015 spring season, announced on Monday, include a revival of Patrick Marber's 1997 play Closer.
Rufus Sewell and Oliver Chris will join Nancy Carroll and newcomer Rachel Redford in the acclaimed romantic drama, which runs from 12 February to 4 April.
The season will also feature Temple, a new play by Steve Waters about the Occupy London camp set up outside at St Paul's Cathedral in 2011.
Running from 21 May to 25 July, Howard Davies' production will see Simon Russell Beale return to the Donmar to play the dean of the cathedral.
The Rt Rev Graeme Knowles resigned as Dean of St Paul's in October 2011, saying his position during the protests had become untenable.
Dr Giles Fraser, the St Paul's canon who also resigned over plans to forcibly evict the Occupy protestors, has reacted to the announcement on Twitter.
"Donmar just announced they putting on play about St Paul's and Occupy," he tweeted on Monday. "Now that will be a thing."
A new play set on the night of the 2015 UK general election is to be shown on television on election night itself.