Solution with 40 servants:
Represent the wines using base-4 number system. You will get 5 digits (for 4^5=1024 wines). A-B-C-D-E (A) For digit A, give wines with values 0,1,2,3 to 4four unique persons respectively. Do similar tests for rest of the digits. There will be 5*4=20 such tests.
(B) Mix wines with AB values {00,1211,2122,33}. Give it to 1one unique person. Do similar tests on all 2-combination of digits. There will be C(5,2)=10 such tests (greenblue graph).
(C) Mix wines with AB values {01,10,2221,32,03}. Give it to 1one unique person. Do similar tests on all 2-combination of digits. There will be C(5,2)=10 such tests (bluegreen graph).


In Step (A), for a given digit, at the most, 2 persons will die. If only one person dies, that digit has one value for both poisonsis resolved. If 2 persons die, it means it has two values (one for each poison).
Let's say two digits D&E got two values each. To link them up, you need to look if the person in Step(B) and Step(C) died for D&E. That is enough to link up the digits.
Explanation:
Look at the two graphs.Assume D has values (1,3). Together, they connect with 0,1,2,3 (all possible values of E). This is the best case. No matter which two values of E you choose, you can uniquely connect them with values of D.
Assume D has values (1,2). Together, they connect with 0,1,2. One value of E (=3) remains unconnected. This is the worst case. Still, no matter which two values of E you select, at least one of them remains connected with values of D. That is enough for us.